diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2012-01-04 08:32:17 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2012-01-04 10:33:28 +0100 |
commit | 6307ca5e22d81da9a39289c2cca9165fea81b3a5 (patch) | |
tree | 1f0a6211d93e9ff8b01fe813b5b625c5845ab9fb /examples/qwindow-compositor | |
parent | 107be565ab3aa4d7c2c82e4094824e0783ecbcbe (diff) |
Remove the size from the mapped signal
Change-Id: I4b49e115c569cab580665040cc9b173c697b1fcc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'examples/qwindow-compositor')
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.cpp | 12 | ||||
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.h | 2 |
2 files changed, 7 insertions, 7 deletions
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: |