diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2013-05-09 21:29:40 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@digia.com> | 2013-05-20 16:25:19 +0200 |
commit | 87dba733acfddecd8562e8e26ce5f994aa499fe3 (patch) | |
tree | 9041a2e4fbde4d832421251f3558239337efa4ac | |
parent | c6c79b1ed4b452a9308bc2f65ec5c4e1c0f9ca77 (diff) |
Don't create wl_shell_surface if BypassWinowManagerHint is set
Custom window types might want to set BypassWinowManagerHint and use
the native Wayland API together with the platform native interface.
In this case wl_shell_surface won't be used.
Change-Id: I66d50fc89901e4ff513b8979d08d7ad7d37f817e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandwindow.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/plugins/platforms/wayland_common/qwaylandwindow.cpp b/src/plugins/platforms/wayland_common/qwaylandwindow.cpp index d8022b75a..926988085 100644 --- a/src/plugins/platforms/wayland_common/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandwindow.cpp @@ -86,7 +86,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window) static WId id = 1; mWindowId = id++; - if (mDisplay->shell()) + if (mDisplay->shell() && !(window->flags() & Qt::BypassWindowManagerHint)) mShellSurface = new QWaylandShellSurface(mDisplay->shell()->get_shell_surface(wl_surface()), this); if (mDisplay->windowExtension()) mExtendedWindow = new QWaylandExtendedSurface(this, mDisplay->windowExtension()->get_extended_surface(wl_surface())); @@ -98,18 +98,19 @@ QWaylandWindow::QWaylandWindow(QWindow *window) mDisplay->windowManagerIntegration()->authenticateWithToken(); #endif - // Set surface class to the .desktop file name (obtained from executable name) - QFileInfo exeFileInfo(qApp->applicationFilePath()); - QString className = exeFileInfo.baseName() + QLatin1String(".desktop"); - mShellSurface->setClassName(className.toUtf8().constData()); + if (mShellSurface) { + // Set surface class to the .desktop file name (obtained from executable name) + QFileInfo exeFileInfo(qApp->applicationFilePath()); + QString className = exeFileInfo.baseName() + QLatin1String(".desktop"); + mShellSurface->setClassName(className.toUtf8().constData()); + } if (QPlatformWindow::parent() && mSubSurfaceWindow) { mSubSurfaceWindow->setParent(static_cast<const QWaylandWindow *>(QPlatformWindow::parent())); } else if (window->transientParent()) { - if (window->transientParent()) { + if (window->transientParent() && mShellSurface) mShellSurface->updateTransientParent(window->transientParent()); - } - } else { + } else if (mShellSurface) { mShellSurface->setTopLevel(); } @@ -400,14 +401,14 @@ bool QWaylandWindow::createDecoration() default: break; } - if (window()->flags() & Qt::FramelessWindowHint || isFullscreen()) { + if (window()->flags() & Qt::FramelessWindowHint || isFullscreen()) + decoration = false; + if (window()->flags() & Qt::BypassWindowManagerHint) decoration = false; - } if (decoration) { - if (!mWindowDecoration) { + if (!mWindowDecoration) mWindowDecoration = new QWaylandDecoration(this); - } } else { delete mWindowDecoration; mWindowDecoration = 0; |