summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2015-03-18 11:21:24 +0100
committerGunnar Sletta <gunnar@sletta.org>2015-03-23 10:57:20 +0000
commit21a79834a926a420c824cea4c478a33758ebbbf8 (patch)
treed2d47f870cd38cc0c671605e7783e7adf896f20e
parent8cbebbcc970c8c00f25cbf2c4823e82608cf89f3 (diff)
downloadqtwayland-21a79834a926a420c824cea4c478a33758ebbbf8.tar.gz
qtwayland-21a79834a926a420c824cea4c478a33758ebbbf8.tar.bz2
qtwayland-21a79834a926a420c824cea4c478a33758ebbbf8.zip
Keep Surface's visibility is in sync between client and compositor.
In change fa32466916f1e0fbd2be28bd48df2d9edfcd5e5f we moved the visibility variable from QtWayland::ExtendedSurface to QtWayland::Surface. But we didn't move the code in the ShellSurface that kept this state in sync with the client. As a result the client and compositor would get out of sync. Change-Id: I54a7cb9f4b0669d3f3839ac8a29d8c42407195e2 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
-rw-r--r--src/compositor/wayland_wrapper/qwlextendedsurface.cpp5
-rw-r--r--src/compositor/wayland_wrapper/qwlextendedsurface_p.h2
-rw-r--r--src/compositor/wayland_wrapper/qwlshellsurface.cpp15
-rw-r--r--src/compositor/wayland_wrapper/qwlsurface_p.h1
4 files changed, 9 insertions, 14 deletions
diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
index 1c6a1417..50cc5bb7 100644
--- a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
+++ b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
@@ -85,11 +85,10 @@ void ExtendedSurface::sendGenericProperty(const QString &name, const QVariant &v
}
-void ExtendedSurface::setVisibility(QWindow::Visibility visibility, bool updateClient)
+void ExtendedSurface::setVisibility(QWindow::Visibility visibility)
{
// If this change came from the client, we shouldn't update it
- if (updateClient)
- send_onscreen_visibility(visibility);
+ send_onscreen_visibility(visibility);
}
void ExtendedSurface::setParentSurface(Surface *surface)
diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h
index e3c37009..8af6232a 100644
--- a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h
+++ b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h
@@ -80,7 +80,7 @@ public:
void sendGenericProperty(const QString &name, const QVariant &variant);
- void setVisibility(QWindow::Visibility visibility, bool updateClient = true);
+ void setVisibility(QWindow::Visibility visibility);
void setSubSurface(ExtendedSurface *subSurface,int x, int y);
void removeSubSurface(ExtendedSurface *subSurfaces);
diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp
index 42c6a56e..e7b4acfd 100644
--- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp
+++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp
@@ -253,8 +253,7 @@ void ShellSurface::shell_surface_set_toplevel(Resource *resource)
setSurfaceType(QWaylandSurface::Toplevel);
- if (m_surface->extendedSurface())
- m_surface->extendedSurface()->setVisibility(QWindow::Windowed, false);
+ m_surface->setVisibility(QWindow::Windowed);
}
void ShellSurface::shell_surface_set_transient(Resource *resource,
@@ -274,8 +273,7 @@ void ShellSurface::shell_surface_set_transient(Resource *resource,
setSurfaceType(QWaylandSurface::Transient);
- if (m_surface->extendedSurface())
- m_surface->extendedSurface()->setVisibility(QWindow::AutomaticVisibility, false);
+ m_surface->setVisibility(QWindow::AutomaticVisibility);
}
void ShellSurface::shell_surface_set_fullscreen(Resource *resource,
@@ -309,8 +307,7 @@ void ShellSurface::shell_surface_set_fullscreen(Resource *resource,
m_view->setPos(output->geometry().topLeft());
send_configure(resize_bottom_right, outputSize.width(), outputSize.height());
- if (m_surface->extendedSurface())
- m_surface->extendedSurface()->setVisibility(QWindow::FullScreen, false);
+ m_surface->setVisibility(QWindow::FullScreen);
}
void ShellSurface::shell_surface_set_popup(Resource *resource, wl_resource *input_device, uint32_t serial, wl_resource *parent, int32_t x, int32_t y, uint32_t flags)
@@ -328,8 +325,7 @@ void ShellSurface::shell_surface_set_popup(Resource *resource, wl_resource *inpu
setSurfaceType(QWaylandSurface::Popup);
- if (m_surface->extendedSurface())
- m_surface->extendedSurface()->setVisibility(QWindow::AutomaticVisibility, false);
+ m_surface->setVisibility(QWindow::AutomaticVisibility);
}
void ShellSurface::shell_surface_set_maximized(Resource *resource,
@@ -359,8 +355,7 @@ void ShellSurface::shell_surface_set_maximized(Resource *resource,
m_view->setPos(output->availableGeometry().topLeft());
send_configure(resize_bottom_right, outputSize.width(), outputSize.height());
- if (m_surface->extendedSurface())
- m_surface->extendedSurface()->setVisibility(QWindow::Maximized, false);
+ m_surface->setVisibility(QWindow::Maximized);
}
void ShellSurface::shell_surface_pong(Resource *resource,
diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h
index 0633a938..4e8f6aa9 100644
--- a/src/compositor/wayland_wrapper/qwlsurface_p.h
+++ b/src/compositor/wayland_wrapper/qwlsurface_p.h
@@ -136,6 +136,7 @@ public:
void frameStarted();
void setMapped(bool mapped);
+ void setVisibility(QWindow::Visibility visibility) { m_visibility = visibility; }
inline bool isDestroyed() const { return m_destroyed; }