From 65444264a9adfd92e941ba08272b7caf493c46db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 1 Oct 2015 08:34:30 +0200 Subject: [PATCH] [server] ShellSurface's transient is a dedicated mode So far transient was a mutual exclusive mode causing a transient window to not be able to be fullscreen. This seems wrong. Let's have transient still as a dedicated mode allowing the window to be maximized and/or fullscreen. Only popup stays a dedicated mode. REVIEW: 125468 --- src/wayland/autotests/client/test_wayland_shell.cpp | 2 +- src/wayland/server/shell_interface.cpp | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/wayland/autotests/client/test_wayland_shell.cpp b/src/wayland/autotests/client/test_wayland_shell.cpp index 7bbdbb1a34..d4cdde52c9 100644 --- a/src/wayland/autotests/client/test_wayland_shell.cpp +++ b/src/wayland/autotests/client/test_wayland_shell.cpp @@ -377,7 +377,7 @@ void TestWaylandShell::testTransient() QCOMPARE(transientOffsetSpy.count(), 1); QCOMPARE(transientOffsetSpy.first().first().toPoint(), QPoint(10, 20)); QCOMPARE(transientForChangedSpy.count(), 1); - QCOMPARE(serverSurface->isToplevel(), false); + QCOMPARE(serverSurface->isToplevel(), true); QCOMPARE(serverSurface->isPopup(), false); QCOMPARE(serverSurface->isTransient(), true); QCOMPARE(serverSurface->transientFor(), QPointer(serverSurface2->surface())); diff --git a/src/wayland/server/shell_interface.cpp b/src/wayland/server/shell_interface.cpp index 0b6b4312ea..17656f1de2 100644 --- a/src/wayland/server/shell_interface.cpp +++ b/src/wayland/server/shell_interface.cpp @@ -79,7 +79,6 @@ public: Fullscreen, Toplevel, Maximized, - Transient, Popup }; WindowMode windowMode = WindowMode::Toplevel; @@ -283,7 +282,7 @@ void ShellSurfaceInterface::Private::setTransientCallback(wl_client *client, wl_ Q_ASSERT(client == *s->client); s->transientFor = QPointer(SurfaceInterface::get(parent)); s->transientOffset = QPoint(x, y); - s->setWindowMode(WindowMode::Transient); + emit s->q_func()->transientChanged(!s->transientFor.isNull()); // TODO: flags emit s->q_func()->transientOffsetChanged(s->transientOffset); emit s->q_func()->transientForChanged(); @@ -320,10 +319,6 @@ void ShellSurfaceInterface::Private::setWindowMode(WindowMode newWindowMode) } if (oldWindowMode == WindowMode::Popup || newWindowMode == WindowMode::Popup) { emit q->popupChanged(windowMode == WindowMode::Popup); - emit q->transientChanged(windowMode == WindowMode::Popup || windowMode == WindowMode::Transient); - } - if (oldWindowMode == WindowMode::Transient || newWindowMode == WindowMode::Transient) { - emit q->transientChanged(windowMode == WindowMode::Popup || windowMode == WindowMode::Transient); } } @@ -339,6 +334,7 @@ void ShellSurfaceInterface::Private::setPopupCallback(wl_client *client, wl_reso s->transientFor = QPointer(SurfaceInterface::get(parent)); s->transientOffset = QPoint(x, y); s->setWindowMode(WindowMode::Popup); + emit s->q_func()->transientChanged(!s->transientFor.isNull()); // TODO: flags emit s->q_func()->transientOffsetChanged(s->transientOffset); emit s->q_func()->transientForChanged(); @@ -430,7 +426,7 @@ bool ShellSurfaceInterface::isPopup() const bool ShellSurfaceInterface::isTransient() const { Q_D(); - return isPopup() || d->windowMode == Private::WindowMode::Transient; + return !d->transientFor.isNull(); } QPoint ShellSurfaceInterface::transientOffset() const