From fde0e243d9ba302996d83e495345fc2110eb9285 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 21 Jan 2022 17:41:30 +0200 Subject: [PATCH] wayland: Let user set "no border" property in more cases It can also be applied to client-side decorations. As long as the compositor can ask the client to use some specific decoration mode, the "no border" property can be set. --- autotests/integration/xdgshellclient_test.cpp | 1 - src/xdgshellclient.cpp | 21 +------------------ 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp index d11c34c456..5d982d02c4 100644 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -995,7 +995,6 @@ void TestXdgShellClient::testXdgDecoration() shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last()[0].toInt()); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); - QCOMPARE(c->userCanSetNoBorder(), expectedMode == Test::XdgToplevelDecorationV1::mode_server_side); QCOMPARE(c->isDecorated(), expectedMode == Test::XdgToplevelDecorationV1::mode_server_side); } diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index 5ac6776cc7..ba7c382d06 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -723,26 +723,7 @@ bool XdgToplevelClient::userCanSetFullScreen() const bool XdgToplevelClient::userCanSetNoBorder() const { - if (m_serverDecoration) { - switch (m_serverDecoration->preferredMode()) { - case ServerSideDecorationManagerInterface::Mode::Server: - return !isFullScreen() && !isShade(); - case ServerSideDecorationManagerInterface::Mode::Client: - case ServerSideDecorationManagerInterface::Mode::None: - return false; - } - } - if (m_xdgDecoration) { - switch (m_xdgDecoration->preferredMode()) { - case XdgToplevelDecorationV1Interface::Mode::Server: - case XdgToplevelDecorationV1Interface::Mode::Undefined: - return Decoration::DecorationBridge::hasPlugin() && !isFullScreen() && !isShade(); - case XdgToplevelDecorationV1Interface::Mode::None: - case XdgToplevelDecorationV1Interface::Mode::Client: - return false; - } - } - return false; + return (m_serverDecoration || m_xdgDecoration) && !isFullScreen() && !isShade(); } bool XdgToplevelClient::noBorder() const