diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-05-08 15:00:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-08 15:00:38 +0100 |
| commit | a6a0cc308c827557d04cb3e4c3b5d258de0411e6 (patch) | |
| tree | 28436a20f9339f1b4fb4cbf915ea9e32ee9eb4ea /src/desktop/Workspace.cpp | |
| parent | 91eb3898ed68a9b583a81d03fe7060a29bc17e80 (diff) | |
desktop/workspace: fix visibility criteria matching (#14349)
ref https://github.com/hyprwm/Hyprland/discussions/14233
Diffstat (limited to 'src/desktop/Workspace.cpp')
| -rw-r--r-- | src/desktop/Workspace.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp index 6ff6d0b4..18f77a63 100644 --- a/src/desktop/Workspace.cpp +++ b/src/desktop/Workspace.cpp @@ -16,6 +16,7 @@ #include <hyprutils/animation/AnimatedVariable.hpp> #include <hyprutils/string/String.hpp> using namespace Hyprutils::String; +using namespace Desktop::View; PHLWORKSPACE CWorkspace::create(WORKSPACEID id, PHLMONITOR monitor, std::string name, bool special, bool isEmpty) { PHLWORKSPACE workspace = makeShared<CWorkspace>(id, monitor, name, special, isEmpty); @@ -436,11 +437,14 @@ int CWorkspace::getWindows(std::optional<bool> onlyTiled, std::optional<bool> on if (!t) continue; + const auto visibilityFulfilled = + t->window() && !t->window()->isHidden() && !t->window()->isInputBlocked(INPUT_BLOCK_GROUP_INACTIVE | INPUT_BLOCK_MONOCLE_INACTIVE | INPUT_BLOCK_BELOW_FULLSCREEN); + if (onlyTiled.has_value() && t->floating() == onlyTiled.value()) continue; if (onlyPinned.has_value() && (!t->window() || t->window()->m_pinned != onlyPinned.value())) continue; - if (onlyVisible.has_value() && (!t->window() || t->window()->targetVisible() != onlyVisible.value())) + if (onlyVisible.has_value() && (!t->window() || visibilityFulfilled != onlyVisible.value())) continue; no++; } @@ -453,13 +457,16 @@ int CWorkspace::getGroups(std::optional<bool> onlyTiled, std::optional<bool> onl for (auto const& g : Desktop::View::groups()) { const auto HEAD = g->head(); + const auto visibilityFulfilled = + g->current() && !g->current()->isHidden() && !g->current()->isInputBlocked(INPUT_BLOCK_GROUP_INACTIVE | INPUT_BLOCK_MONOCLE_INACTIVE | INPUT_BLOCK_BELOW_FULLSCREEN); + if (HEAD->workspaceID() != m_id || !HEAD->m_isMapped) continue; if (onlyTiled.has_value() && HEAD->m_isFloating == onlyTiled.value()) continue; if (onlyPinned.has_value() && HEAD->m_pinned != onlyPinned.value()) continue; - if (onlyVisible.has_value() && g->current()->targetVisible() != onlyVisible.value()) + if (onlyVisible.has_value() && visibilityFulfilled != onlyVisible.value()) continue; no++; } |
