diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-11-01 13:48:52 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-04-08 07:51:16 +0000 |
commit | 5405de120bba480f780e37e90fbd7c2ff1308b01 (patch) | |
tree | 5c62a9475fefd392785583a4a08c15397c73ce1a /src/client/qwaylandwindow.cpp | |
parent | d65783c9e1f40e176943b8706bf6bbed8320bcc8 (diff) |
Client: Don't be exposed if we want to create a sub or shell surface
Because some shells don't allow attaching buffers before configure, we need to
not be exposed until we know that we don't want a shell surface.
Change-Id: Ida7101a99f953d02cf6401e4ea8d28cfabd6e102
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index c46c49813..79639cba0 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -50,6 +50,7 @@ #include "qwaylandnativeinterface_p.h" #include "qwaylanddecorationfactory_p.h" #include "qwaylandshmbackingstore_p.h" +#include "qwaylandshellintegration_p.h" #if QT_CONFIG(wayland_datadevice) #include "qwaylanddatadevice_p.h" @@ -138,8 +139,9 @@ void QWaylandWindow::initWindow() } } else if (shouldCreateShellSurface()) { Q_ASSERT(!mShellSurface); + Q_ASSERT(mDisplay->shellIntegration()); - mShellSurface = mDisplay->createShellSurface(this); + mShellSurface = mDisplay->shellIntegration()->createShellSurface(this); if (mShellSurface) { // Set initial surface title setWindowTitle(window()->title()); @@ -211,6 +213,9 @@ void QWaylandWindow::initializeWlSurface() bool QWaylandWindow::shouldCreateShellSurface() const { + if (!mDisplay->shellIntegration()) + return false; + if (shouldCreateSubSurface()) return false; @@ -958,9 +963,16 @@ void QWaylandWindow::unfocus() bool QWaylandWindow::isExposed() const { + if (!window()->isVisible()) + return false; + if (mShellSurface) - return window()->isVisible() && mShellSurface->isExposed(); - return QPlatformWindow::isExposed(); + return mShellSurface->isExposed(); + + if (mSubSurfaceWindow) + return mSubSurfaceWindow->parent()->isExposed(); + + return !(shouldCreateShellSurface() || shouldCreateSubSurface()); } bool QWaylandWindow::isActive() const |