diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -425,8 +425,7 @@ virtual bool isHiddenInternal() const = 0; // TODO: remove boolean trap virtual void hideClient(bool hide) = 0; - bool isFullScreenable() const; - bool isFullScreenable(bool fullscreen_hack) const; + virtual bool isFullScreenable() const = 0; virtual bool isFullScreen() const = 0; // TODO: remove boolean trap virtual AbstractClient *findModal(bool allow_itself = false) = 0; diff --git a/client.h b/client.h --- a/client.h +++ b/client.h @@ -143,6 +143,7 @@ bool isMinimizable() const override; QRect iconGeometry() const override; + bool isFullScreenable() const override; void setFullScreen(bool set, bool user = true) override; bool isFullScreen() const override; bool userCanSetFullScreen() const override; @@ -347,6 +348,8 @@ Client* findAutogroupCandidate() const; + bool isFullScreenable(bool fullscreenHack) const; + protected: virtual void debug(QDebug& stream) const; void addDamage(const QRegion &damage) override; diff --git a/client.cpp b/client.cpp --- a/client.cpp +++ b/client.cpp @@ -595,6 +595,30 @@ return noborder; } +bool Client::isFullScreenable() const +{ + return isFullScreenable(false); +} + +bool Client::isFullScreenable(bool fullscreenHack) const +{ + if (!rules()->checkFullScreen(true)) { + return false; + } + if (fullscreenHack) { + return isNormalWindow(); + } + if (rules()->checkStrictGeometry(true)) { + // check geometry constraints (rule to obey is set) + const QRect fsarea = workspace()->clientArea(FullScreenArea, this); + if (sizeForClientSize(fsarea.size(), SizemodeAny, true) != fsarea.size()) { + return false; // the app wouldn't fit exactly fullscreen geometry due to its strict geometry requirements + } + } + // don't check size constrains - some apps request fullscreen despite requesting fixed size + return !isSpecialWindow(); // also better disallow only weird types to go fullscreen +} + bool Client::noBorder() const { return userNoBorder() || isFullScreen(); diff --git a/geometry.cpp b/geometry.cpp --- a/geometry.cpp +++ b/geometry.cpp @@ -2449,26 +2449,6 @@ emit quickTileModeChanged(); } -bool AbstractClient::isFullScreenable() const -{ - return isFullScreenable(false); -} - -bool AbstractClient::isFullScreenable(bool fullscreen_hack) const -{ - if (!rules()->checkFullScreen(true)) - return false; - if (fullscreen_hack) - return isNormalWindow(); - if (rules()->checkStrictGeometry(true)) { // allow rule to ignore geometry constraints - QRect fsarea = workspace()->clientArea(FullScreenArea, this); - if (sizeForClientSize(fsarea.size(), SizemodeAny, true) != fsarea.size()) - return false; // the app wouldn't fit exactly fullscreen geometry due to its strict geometry requirements - } - // don't check size constrains - some apps request fullscreen despite requesting fixed size - return !isSpecialWindow(); // also better disallow only weird types to go fullscreen -} - bool Client::userCanSetFullScreen() const { if (fullscreen_mode == FullScreenHack) diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -77,6 +77,7 @@ void closeWindow() override; AbstractClient *findModal(bool allow_itself = false) override; bool isCloseable() const override; + bool isFullScreenable() const override; bool isFullScreen() const override; bool isMaximizable() const override; bool isMinimizable() const override; diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -931,6 +931,14 @@ return true; } +bool ShellClient::isFullScreenable() const +{ + if (!rules()->checkFullScreen(true)) { + return false; + } + return !isSpecialWindow(); +} + void ShellClient::setFullScreen(bool set, bool user) { if (!isFullScreen() && !set)