diff options
Diffstat (limited to 'src/desktop/view')
| -rw-r--r-- | src/desktop/view/Window.cpp | 17 | ||||
| -rw-r--r-- | src/desktop/view/Window.hpp | 17 |
2 files changed, 24 insertions, 10 deletions
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp index b2f4821b..19f8f88d 100644 --- a/src/desktop/view/Window.cpp +++ b/src/desktop/view/Window.cpp @@ -48,6 +48,7 @@ #include "../../managers/input/InputManager.hpp" #include "../../managers/PointerManager.hpp" #include "../../managers/animation/DesktopAnimationManager.hpp" +#include "../../layout/algorithm/Algorithm.hpp" #include "../../layout/space/Space.hpp" #include "../../layout/LayoutManager.hpp" #include "../../layout/target/WindowTarget.hpp" @@ -267,7 +268,7 @@ CBox CWindow::getWindowIdealBoundingBoxIgnoreReserved() { auto POS = m_position; auto SIZE = m_size; - if (isFullscreen()) { + if (isFullscreen() && (!layoutTarget() || !layoutTarget()->layoutManagedFullscreen())) { POS = PMONITOR->m_position; SIZE = PMONITOR->m_size; @@ -748,12 +749,12 @@ bool CWindow::isInputBlocked() const { return m_inputBlockReasons != INPUT_BLOCK_NONE; } -bool CWindow::isInputBlocked(eWindowInputBlockReason reason) const { - return (m_inputBlockReasons & sc<uint32_t>(reason)) != 0; +bool CWindow::isInputBlocked(std::underlying_type_t<eWindowInputBlockReason> reasons) const { + return (m_inputBlockReasons & reasons) != 0; } bool CWindow::isInputBlockedOnly(eWindowInputBlockReason reason) const { - return m_inputBlockReasons == sc<uint32_t>(reason); + return m_inputBlockReasons == reason; } bool CWindow::acceptsInput() const { @@ -772,7 +773,13 @@ bool CWindow::isAllowedOverFullscreen() const { } bool CWindow::isBlockedByFullscreen() const { - if (!m_workspace || !m_workspace->m_hasFullscreenWindow) + if (!m_workspace) + return false; + + const auto ALGORITHM = m_workspace->m_space ? m_workspace->m_space->algorithm() : nullptr; + const bool HAS_LAYOUT_FULLSCREEN = ALGORITHM && ALGORITHM->layoutFullscreenCoversMonitor(); + + if (!m_workspace->m_hasFullscreenWindow && !HAS_LAYOUT_FULLSCREEN) return false; return !isAllowedOverFullscreen(); diff --git a/src/desktop/view/Window.hpp b/src/desktop/view/Window.hpp index 32a7bcfe..6174e694 100644 --- a/src/desktop/view/Window.hpp +++ b/src/desktop/view/Window.hpp @@ -89,11 +89,13 @@ namespace Desktop::View { WINDOW_ALPHA_LAST, }; - enum eWindowInputBlockReason : uint32_t { + enum eWindowInputBlockReason : uint8_t { INPUT_BLOCK_NONE = 0, - INPUT_BLOCK_GROUP_INACTIVE = 1 << 0, - INPUT_BLOCK_MONOCLE_INACTIVE = 1 << 1, - INPUT_BLOCK_BELOW_FULLSCREEN = 1 << 2, + INPUT_BLOCK_GROUP_INACTIVE = (1 << 0), + INPUT_BLOCK_MONOCLE_INACTIVE = (1 << 1), + INPUT_BLOCK_BELOW_FULLSCREEN = (1 << 2), + + INPUT_BLOCK_ALL = std::numeric_limits<std::underlying_type_t<eWindowInputBlockReason>>::max(), }; struct SWindowActiveEvent { @@ -285,6 +287,11 @@ namespace Desktop::View { // For the noclosefor windowrule Time::steady_tp m_closeableSince = Time::steadyNow(); + // layout-settable flags. These are reset when layout changes. + struct { + bool cantLockCursor = false; + } m_layoutFlags; + // For the list lookup bool operator==(const CWindow& rhs) const { return m_xdgSurface == rhs.m_xdgSurface && m_xwaylandSurface == rhs.m_xwaylandSurface && m_position == rhs.m_position && m_size == rhs.m_size && @@ -314,7 +321,7 @@ namespace Desktop::View { bool isHidden() const; void setInputBlocked(eWindowInputBlockReason reason, bool blocked); bool isInputBlocked() const; - bool isInputBlocked(eWindowInputBlockReason reason) const; + bool isInputBlocked(std::underlying_type_t<eWindowInputBlockReason> reasons) const; bool isInputBlockedOnly(eWindowInputBlockReason reason) const; bool acceptsInput() const; bool isAllowedOverFullscreen() const; |
