m_compositor->setScreenOrientation(orientationInDegrees);
}
+void WaylandCompositor::setOutputGeometry(const QRect &geometry)
+{
+ m_compositor->setOutputGeometry(geometry);
+}
++
+ bool WaylandCompositor::isDragging() const
+ {
+ return m_compositor->isDragging();
+ }
+
+ void WaylandCompositor::sendDragMoveEvent(const QPoint &global, const QPoint &local,
+ WaylandSurface *surface)
+ {
+ m_compositor->sendDragMoveEvent(global, local, surface ? surface->handle() : 0);
+ }
+
+ void WaylandCompositor::sendDragEndEvent()
+ {
+ m_compositor->sendDragEndEvent();
+ }
+
+ void WaylandCompositor::changeCursor(const QImage &image, int hotspotX, int hotspotY)
+ {
+ Q_UNUSED(image);
+ Q_UNUSED(hotspotX);
+ Q_UNUSED(hotspotY);
+ qDebug() << "changeCursor" << image.size() << hotspotX << hotspotY;
+ }
const char *socketName() const;
void setScreenOrientation(qint32 orientationInDegrees);
+ void setOutputGeometry(const QRect &outputGeometry);
+ bool isDragging() const;
+ void sendDragMoveEvent(const QPoint &global, const QPoint &local, WaylandSurface *surface);
+ void sendDragEndEvent();
+
+ virtual void changeCursor(const QImage &image, int hotspotX, int hotspotY);
+
private:
static void retainedSelectionChanged(QMimeData *mimeData, void *param);
QList<struct wl_client *> clients() const;
void setScreenOrientation(qint32 orientationInDegrees);
+ void setOutputGeometry(const QRect &geometry);
+ bool isDragging() const;
+ void sendDragMoveEvent(const QPoint &global, const QPoint &local, Surface *surface);
+ void sendDragEndEvent();
+
signals:
void clientAdded(wl_client *client);
Output::Output()
- : m_geometry(QPoint(0,0), QApplication::desktop()->screenGeometry().size())
- , m_displayId(-1)
+ : m_displayId(-1)
, m_numQueued(0)
{
-
+ QScreen *screen = QGuiApplication::primaryScreen();
- m_size = screen->availableGeometry().size();
++ m_geometry = QRect(QPoint(0, 0), screen->availableGeometry().size());
}
+void Output::setGeometry(const QRect &geometry)
+{
+ m_geometry = geometry;
}
+
+} // namespace Wayland
GLuint texture_id;
#endif
bool textureCreatedForBuffer;
- wl_buffer *directRenderBuffer;
+ struct wl_buffer *directRenderBuffer;
qint64 processId;
QByteArray authenticationToken;
+ QVariantMap windowProperties;
+ QPoint lastMousePos;
+
+ struct wl_buffer *previousBuffer;
private:
struct wl_buffer *surfaceBuffer;
WaylandSurface::Type surfaceType;
return WindowManagerServerIntegration::instance()->managedClient(d->client)->authenticationToken();
}
+QVariantMap Surface::windowProperties() const
+{
+ Q_D(const Surface);
+ return d->windowProperties;
+}
+
+QVariant Surface::windowProperty(const QString &propertyName) const
+{
+ Q_D(const Surface);
+ QVariantMap props = d->windowProperties;
+ return props.value(propertyName);
+}
+
+void Surface::setWindowProperty(const QString &name, const QVariant &value, bool writeUpdateToClient)
+{
+ Q_D(Surface);
+ d->windowProperties.insert(name, value);
+ if (writeUpdateToClient)
+ WindowManagerServerIntegration::instance()->setWindowProperty(d->client, base(), name, value);
+}
+
uint32_t toWaylandButton(Qt::MouseButton button)
{
+ #ifndef BTN_LEFT
+ uint32_t BTN_LEFT = 0x110;
+ uint32_t BTN_RIGHT = 0x111;
+ uint32_t BTN_MIDDLE = 0x112;
+ #endif
switch (button) {
case Qt::LeftButton:
return BTN_LEFT;
qint64 processId() const;
void setProcessId(qint64 processId);
QByteArray authenticationToken() const;
+ void setAuthenticationToken(const QByteArray &authenticationToken);
+ QVariantMap windowProperties() const;
+ QVariant windowProperty(const QString &propertyName) const;
+ void setWindowProperty(const QString &name, const QVariant &value, bool writeUpdateToClient = true);
+
void setSurfaceCreationFinished(bool isCreated);
+ QPoint lastMousePos() const;
+
protected:
QScopedPointer<SurfacePrivate> d_ptr;
private: