diff options
| author | JManch <61563764+JManch@users.noreply.github.com> | 2024-03-03 17:04:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-03 17:04:39 +0000 |
| commit | 8ccbd272cc5f3a98280d4e050f456d25aee47ee5 (patch) | |
| tree | 8f6f3b3b5f4ef74bb7d9a7813d7fbbaf888abc8d /src/Compositor.cpp | |
| parent | 28272d2d7450eb7fffaee42d2d2da06171e626c2 (diff) | |
compositor: ignore grab extend behind special workspaces (#4944)
* compositor: ignore grab extend behind special workspaces
* ignore the window entirely
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 37626da9..7cbe3e13 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -739,8 +739,16 @@ CWindow* CCompositor::vectorToWindowUnified(const Vector2D& pos, uint8_t propert if (special && !isWorkspaceSpecial(w->m_iWorkspaceID)) // because special floating may creep up into regular continue; - const auto BB = w->getWindowBoxUnified(properties); - CBox box = {BB.x - BORDER_GRAB_AREA, BB.y - BORDER_GRAB_AREA, BB.width + 2 * BORDER_GRAB_AREA, BB.height + 2 * BORDER_GRAB_AREA}; + const auto BB = w->getWindowBoxUnified(properties); + const auto PWINDOWMONITOR = getMonitorFromID(w->m_iMonitorID); + + // to avoid focusing windows behind special workspaces from other monitors + if (!**PSPECIALFALLTHRU && PWINDOWMONITOR && PWINDOWMONITOR->specialWorkspaceID && w->m_iWorkspaceID != PWINDOWMONITOR->specialWorkspaceID && + BB.x >= PWINDOWMONITOR->vecPosition.x && BB.y >= PWINDOWMONITOR->vecPosition.y && + BB.x + BB.width <= PWINDOWMONITOR->vecPosition.x + PWINDOWMONITOR->vecSize.x && BB.y + BB.height <= PWINDOWMONITOR->vecPosition.y + PWINDOWMONITOR->vecSize.y) + continue; + + CBox box = {BB.x - BORDER_GRAB_AREA, BB.y - BORDER_GRAB_AREA, BB.width + 2 * BORDER_GRAB_AREA, BB.height + 2 * BORDER_GRAB_AREA}; if (w->m_bIsFloating && w->m_bIsMapped && isWorkspaceVisible(w->m_iWorkspaceID) && !w->isHidden() && !w->m_bPinned && !w->m_sAdditionalConfigData.noFocus && w.get() != pIgnoreWindow && (!aboveFullscreen || w->m_bCreatedOverFullscreen)) { // OR windows should add focus to parent |
