summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-03-25 14:49:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-29 10:46:48 +0200
commit96ab8abe0b0faea7f63f0477025fe0649e410362 (patch)
tree9c868346e0e27155b72ed9cc4bd7992c1d9fdddf /examples
parentfc439e40e37f9c0b3108225f951fb19bb3abee80 (diff)
Let the ShellSurface send the mapped and unmapped signals.
A surface without any attached shell surface should never be mapped, so make the latter set the mapped state on the surface. Change-Id: If09bd9eebecd6e0a52f862cb866d85aec403c3a0 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qml-compositor/main.cpp4
-rw-r--r--examples/qwindow-compositor/qwindowcompositor.cpp14
-rw-r--r--examples/qwindow-compositor/qwindowcompositor.h2
3 files changed, 8 insertions, 12 deletions
diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp
index 7ebcb6c29..dbabc9d04 100644
--- a/examples/qml-compositor/main.cpp
+++ b/examples/qml-compositor/main.cpp
@@ -95,10 +95,6 @@ public slots:
private slots:
void surfaceMapped() {
QWaylandQuickSurface *surface = qobject_cast<QWaylandQuickSurface *>(sender());
- //Ignore surface if it's not a window surface
- if (!surface->hasShellSurface())
- return;
-
emit windowAdded(QVariant::fromValue(surface));
}
void surfaceUnmapped() {
diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp
index aa6afd7aa..b485064f1 100644
--- a/examples/qwindow-compositor/qwindowcompositor.cpp
+++ b/examples/qwindow-compositor/qwindowcompositor.cpp
@@ -191,11 +191,10 @@ void QWindowCompositor::surfaceMapped()
} else {
m_surfaces.removeOne(surface);
}
- //Sometimes surfaces dont have shell_surfaces, so don't render them
- if (surface->hasShellSurface()) {
- m_surfaces.append(surface);
- defaultInputDevice()->setKeyboardFocus(surface);
- }
+
+ m_surfaces.append(surface);
+ defaultInputDevice()->setKeyboardFocus(surface);
+
m_renderScheduler.start(0);
}
@@ -245,8 +244,9 @@ void QWindowCompositor::sendExpose()
surface->sendOnScreenVisibilityChange(true);
}
-void QWindowCompositor::updateCursor()
+void QWindowCompositor::updateCursor(bool hasBuffer)
{
+ Q_UNUSED(hasBuffer)
if (!m_cursorSurface)
return;
@@ -270,7 +270,7 @@ QPointF QWindowCompositor::toSurface(QWaylandSurface *surface, const QPointF &po
void QWindowCompositor::setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY)
{
if ((m_cursorSurface != surface) && surface)
- connect(surface, SIGNAL(configure()), this, SLOT(updateCursor()));
+ connect(surface, SIGNAL(configure(bool)), this, SLOT(updateCursor(bool)));
m_cursorSurface = surface;
m_cursorHotspotX = hotspotX;
diff --git a/examples/qwindow-compositor/qwindowcompositor.h b/examples/qwindow-compositor/qwindowcompositor.h
index 3ecbdbc1a..c84bb9145 100644
--- a/examples/qwindow-compositor/qwindowcompositor.h
+++ b/examples/qwindow-compositor/qwindowcompositor.h
@@ -85,7 +85,7 @@ protected:
private slots:
void sendExpose();
- void updateCursor();
+ void updateCursor(bool hasBuffer);
private:
QOpenGLWindow *m_window;