diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -85,7 +85,9 @@ AbstractClient *findModal(bool allow_itself = false) override; bool isCloseable() const override; bool isFullScreenable() const override; - bool isFullScreen() const override; + bool isFullScreen() const override { + return m_fullScreen; + } bool isMaximizable() const override; bool isMinimizable() const override; bool isMovable() const override; diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -745,11 +745,6 @@ return m_qtExtendedSurface ? true : false; } -bool ShellClient::isFullScreen() const -{ - return m_fullScreen; -} - bool ShellClient::isMaximizable() const { if (m_internal) { @@ -954,14 +949,20 @@ void ShellClient::setFullScreen(bool set, bool user) { - if (!isFullScreen() && !set) + set = rules()->checkFullScreen(set); + + const bool wasFullscreen = isFullScreen(); + if (wasFullscreen == set) { return; - if (user && !userCanSetFullScreen()) + } + if (isSpecialWindow()) { return; - set = rules()->checkFullScreen(set && !isSpecialWindow()); - setShade(ShadeNone); - bool was_fs = isFullScreen(); - if (was_fs) { + } + if (user && !userCanSetFullScreen()) { + return; + } + + if (wasFullscreen) { workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event } else { // in shell surface, maximise mode and fullscreen are exclusive @@ -973,18 +974,19 @@ } } m_fullScreen = set; - if (was_fs == isFullScreen()) - return; + if (set) { untab(); workspace()->raiseClient(this); } RequestGeometryBlocker requestBlocker(this); StackingUpdatesBlocker blocker1(workspace()); GeometryUpdatesBlocker blocker2(this); + workspace()->updateClientLayer(this); // active fullscreens get different layer updateDecoration(false, false); - if (isFullScreen()) { + + if (set) { setGeometry(workspace()->clientArea(FullScreenArea, this)); } else { if (!m_geomFsRestore.isNull()) { @@ -997,11 +999,9 @@ setGeometry(workspace()->clientArea(MaximizeArea, this)); } } - updateWindowRules(Rules::Fullscreen|Rules::Position|Rules::Size); - if (was_fs != isFullScreen()) { - emit fullScreenChanged(); - } + updateWindowRules(Rules::Fullscreen|Rules::Position|Rules::Size); + emit fullScreenChanged(); } void ShellClient::setNoBorder(bool set)