diff --git a/autotests/integration/xdgshellwindow_test.cpp b/autotests/integration/xdgshellwindow_test.cpp index a5a05d88ef..8b22a72b9f 100644 --- a/autotests/integration/xdgshellwindow_test.cpp +++ b/autotests/integration/xdgshellwindow_test.cpp @@ -438,7 +438,7 @@ void TestXdgShellWindow::testUserCanSetFullscreen() QVERIFY(window); QVERIFY(window->isActive()); QVERIFY(!window->isFullScreen()); - QVERIFY(window->userCanSetFullScreen()); + QVERIFY(window->isFullScreenable()); } void TestXdgShellWindow::testSendFullScreenWindowToAnotherOutput() diff --git a/src/useractions.cpp b/src/useractions.cpp index d7243f7dcf..c170024fd9 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -336,7 +336,7 @@ void UserActionsMenu::menuAboutToShow() m_shadeOperation->setChecked(m_window->shadeMode() != ShadeNone); m_keepAboveOperation->setChecked(m_window->keepAbove()); m_keepBelowOperation->setChecked(m_window->keepBelow()); - m_fullScreenOperation->setEnabled(m_window->userCanSetFullScreen()); + m_fullScreenOperation->setEnabled(m_window->isFullScreenable()); m_fullScreenOperation->setChecked(m_window->isFullScreen()); m_noBorderOperation->setEnabled(m_window->userCanSetNoBorder()); m_noBorderOperation->setChecked(m_window->noBorder()); @@ -750,7 +750,7 @@ void UserActionsMenu::slotWindowOperation(QAction *action) QString type; switch (op) { case Options::FullScreenOp: - if (!c->isFullScreen() && c->userCanSetFullScreen()) { + if (!c->isFullScreen() && c->isFullScreenable()) { type = QStringLiteral("fullscreenaltf3"); } break; diff --git a/src/window.cpp b/src/window.cpp index 02a2111f35..b8b55cdbf6 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3934,16 +3934,6 @@ bool Window::isRequestedFullScreen() const return isFullScreen(); } -/** - * Returns whether requests initiated by the user to enter or leave full screen mode are honored. - * - * Default implementation returns @c false. - */ -bool Window::userCanSetFullScreen() const -{ - return false; -} - /** * Asks the Window to enter or leave full screen mode. * diff --git a/src/window.h b/src/window.h index d71e046a0a..2635487033 100644 --- a/src/window.h +++ b/src/window.h @@ -995,7 +995,6 @@ public: virtual bool isFullScreenable() const; virtual bool isFullScreen() const; virtual bool isRequestedFullScreen() const; - virtual bool userCanSetFullScreen() const; virtual void setFullScreen(bool set); QRectF geometryRestore() const; diff --git a/src/x11window.cpp b/src/x11window.cpp index 0900a4c134..8823c2b142 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -1475,7 +1475,7 @@ bool X11Window::isFullScreenable() const } } // don't check size constrains - some apps request fullscreen despite requesting fixed size - return !isSpecialWindow(); // also better disallow only weird types to go fullscreen + return isNormalWindow() || isDialog(); // also better disallow only weird types to go fullscreen } bool X11Window::noBorder() const @@ -2615,7 +2615,7 @@ void X11Window::updateAllowedActions(bool force) if (isMaximizable()) { allowed_actions |= NET::ActionMax; } - if (userCanSetFullScreen()) { + if (isFullScreenable()) { allowed_actions |= NET::ActionFullScreen; } allowed_actions |= NET::ActionChangeDesktop; // Always (Pagers shouldn't show Docks etc.) @@ -4651,17 +4651,6 @@ void X11Window::maximize(MaximizeMode mode) } } -bool X11Window::userCanSetFullScreen() const -{ - if (isUnmanaged()) { - return false; - } - if (!isFullScreenable()) { - return false; - } - return isNormalWindow() || isDialog(); -} - void X11Window::setFullScreen(bool set) { set = rules()->checkFullScreen(set); @@ -4670,7 +4659,7 @@ void X11Window::setFullScreen(bool set) if (wasFullscreen == set) { return; } - if (!userCanSetFullScreen()) { + if (!isFullScreenable()) { return; } diff --git a/src/x11window.h b/src/x11window.h index bb617321a2..3349439135 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -154,7 +154,6 @@ public: bool isFullScreenable() const override; void setFullScreen(bool set) override; bool isFullScreen() const override; - bool userCanSetFullScreen() const override; int fullScreenMode() const { return m_fullscreenMode; // only for session saving diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 67bb7d96cf..15f42f470a 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -606,11 +606,6 @@ bool XdgToplevelWindow::isTransient() const return m_isTransient; } -bool XdgToplevelWindow::userCanSetFullScreen() const -{ - return true; -} - bool XdgToplevelWindow::userCanSetNoBorder() const { return (m_serverDecoration || m_xdgDecoration) && !isFullScreen() && !isShade(); @@ -1432,14 +1427,12 @@ void XdgToplevelWindow::installPalette(ServerSideDecorationPaletteInterface *pal void XdgToplevelWindow::setFullScreen(bool set) { - set = rules()->checkFullScreen(set); - if (m_isRequestedFullScreen == set) { + if (!isFullScreenable()) { return; } - if (isSpecialWindow()) { - return; - } - if (!userCanSetFullScreen()) { + + set = rules()->checkFullScreen(set); + if (m_isRequestedFullScreen == set) { return; } diff --git a/src/xdgshellwindow.h b/src/xdgshellwindow.h index a4eeeec94a..85dba45617 100644 --- a/src/xdgshellwindow.h +++ b/src/xdgshellwindow.h @@ -143,7 +143,6 @@ public: bool isMinimizable() const override; bool isPlaceable() const override; bool isTransient() const override; - bool userCanSetFullScreen() const override; bool userCanSetNoBorder() const override; bool noBorder() const override; void setNoBorder(bool set) override;