diff options
-rw-r--r-- | examples/qml-compositor/main.cpp | 4 | ||||
-rw-r--r-- | examples/qwidget-compositor/main.cpp | 10 | ||||
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.cpp | 12 | ||||
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.h | 2 | ||||
-rw-r--r-- | src/compositor/compositor_api/waylandsurface.h | 2 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/wlsurface.cpp | 2 |
6 files changed, 16 insertions, 16 deletions
diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp index 4a9bf05a2..fc6a4618e 100644 --- a/examples/qml-compositor/main.cpp +++ b/examples/qml-compositor/main.cpp @@ -76,7 +76,7 @@ public slots: } private slots: - void surfaceMapped(const QSize &size) { + void surfaceMapped() { WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); surface->setGeometry(QRect(surface->geometry().topLeft(),size)); @@ -107,7 +107,7 @@ private slots: protected: void surfaceCreated(WaylandSurface *surface) { - connect(surface, SIGNAL(mapped(const QSize &)), this, SLOT(surfaceMapped(const QSize &))); + connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); } private: diff --git a/examples/qwidget-compositor/main.cpp b/examples/qwidget-compositor/main.cpp index ce7f50cd3..b074735b0 100644 --- a/examples/qwidget-compositor/main.cpp +++ b/examples/qwidget-compositor/main.cpp @@ -106,14 +106,14 @@ private slots: update(); } - void surfaceMapped(const QSize &size) { + void surfaceMapped() { WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); QPoint pos; if (!m_surfaces.contains(surface)) { - uint px = 1 + (qrand() % (width() - size.width() - 2)); - uint py = 1 + (qrand() % (height() - size.height() - 2)); + uint px = 1 + (qrand() % (width() - surface->geometry().size().width() - 2)); + uint py = 1 + (qrand() % (height() - surface->geometry().size().height() - 2)); pos = QPoint(px, py); - surface->setGeometry(QRect(pos, size)); + surface->setGeometry(QRect(pos, surface->geometry().size())); m_surfaces.append(surface); } else { surface->setGeometry(QRect(geometry().topLeft(),size)); @@ -142,7 +142,7 @@ protected: void surfaceCreated(WaylandSurface *surface) { qDebug() << "surface created"; connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); - connect(surface, SIGNAL(mapped(const QSize &)), this, SLOT(surfaceMapped(const QSize &))); + connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &))); update(); } diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp index 38f68ad39..039dfdd9c 100644 --- a/examples/qwindow-compositor/qwindowcompositor.cpp +++ b/examples/qwindow-compositor/qwindowcompositor.cpp @@ -27,17 +27,17 @@ void QWindowCompositor::surfaceDestroyed(QObject *object) render(); } -void QWindowCompositor::surfaceMapped(const QSize &size) +void QWindowCompositor::surfaceMapped() { WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); QPoint pos; if (!m_surfaces.contains(surface)) { - uint px = 1 + (qrand() % (m_window->width() - size.width() - 2)); - uint py = 1 + (qrand() % (m_window->height() - size.height() - 2)); + uint px = 1 + (qrand() % (m_window->width() - surface->geometry().size().width() - 2)); + uint py = 1 + (qrand() % (m_window->height() - surface->geometry().size().height() - 2)); pos = QPoint(px, py); - surface->setGeometry(QRect(pos, size)); + surface->setGeometry(QRect(pos, surface->geometry().size())); } else { - surface->setGeometry(QRect(window()->geometry().topLeft(),size)); + surface->setGeometry(QRect(window()->geometry().topLeft(),surface->geometry().size())); m_surfaces.removeOne(surface); } m_surfaces.append(surface); @@ -61,7 +61,7 @@ void QWindowCompositor::surfaceDamaged(WaylandSurface *surface, const QRect &rec void QWindowCompositor::surfaceCreated(WaylandSurface *surface) { connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); - connect(surface, SIGNAL(mapped(const QSize &)), this, SLOT(surfaceMapped(const QSize &))); + connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &))); render(); } diff --git a/examples/qwindow-compositor/qwindowcompositor.h b/examples/qwindow-compositor/qwindowcompositor.h index f6c32e2e9..247260406 100644 --- a/examples/qwindow-compositor/qwindowcompositor.h +++ b/examples/qwindow-compositor/qwindowcompositor.h @@ -15,7 +15,7 @@ public: QWindowCompositor(QOpenGLWindow *window); private slots: void surfaceDestroyed(QObject *object); - void surfaceMapped(const QSize &size); + void surfaceMapped(); void surfaceDamaged(const QRect &rect); protected: diff --git a/src/compositor/compositor_api/waylandsurface.h b/src/compositor/compositor_api/waylandsurface.h index cc01c19c0..45c308a6b 100644 --- a/src/compositor/compositor_api/waylandsurface.h +++ b/src/compositor/compositor_api/waylandsurface.h @@ -111,7 +111,7 @@ public: void setWindowProperty(const QString &name, const QVariant &value); signals: - void mapped(const QSize &size); + void mapped(); void unmapped(); void damaged(const QRect &rect); void windowPropertyChanged(const QString &name, const QVariant &value); diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp index 7e1b21757..04f87ef03 100644 --- a/src/compositor/wayland_wrapper/wlsurface.cpp +++ b/src/compositor/wayland_wrapper/wlsurface.cpp @@ -420,7 +420,7 @@ void Surface::attach(struct wl_buffer *buffer) } d->surfaceBuffer = newBuffer; if (emitMap) { - d->qtSurface->mapped(QSize(d->surfaceBuffer->width(),d->surfaceBuffer->height())); + d->qtSurface->mapped(); } else if (emitUnmap) { d->qtSurface->unmapped(); } |