aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorEpilepsy Gatherings <[email protected]>2024-01-07 06:06:33 -0500
committerGitHub <[email protected]>2024-01-07 12:06:33 +0100
commit666ee61c13e67e3a6943cd96157d9fb0967e596a (patch)
tree86a2b0bd72ef4cafd3cdf24e6756b172935f9155 /src/Compositor.cpp
parent7e033e48ace5406a9bc442f7d403f9ce3af193f3 (diff)
downloadHyprland-666ee61c13e67e3a6943cd96157d9fb0967e596a.tar.gz
Hyprland-666ee61c13e67e3a6943cd96157d9fb0967e596a.zip
input: leave special on focus (#4358)
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index af03e025..f3efad86 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -928,12 +928,13 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
if (pWindow->m_bPinned)
pWindow->m_iWorkspaceID = m_pLastMonitor->activeWorkspace;
+ const auto PMONITOR = getMonitorFromID(pWindow->m_iMonitorID);
+
if (!isWorkspaceVisible(pWindow->m_iWorkspaceID)) {
+ const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID);
// This is to fix incorrect feedback on the focus history.
- const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID);
PWORKSPACE->m_pLastFocusedWindow = pWindow;
PWORKSPACE->rememberPrevWorkspace(getWorkspaceByID(m_pLastMonitor->activeWorkspace));
- const auto PMONITOR = getMonitorFromID(PWORKSPACE->m_iMonitorID);
PMONITOR->changeWorkspace(PWORKSPACE, false, true);
// changeworkspace already calls focusWindow
return;
@@ -942,6 +943,9 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
const auto PLASTWINDOW = m_pLastWindow;
m_pLastWindow = pWindow;
+ if (PMONITOR->specialWorkspaceID && PMONITOR->specialWorkspaceID != pWindow->m_iWorkspaceID)
+ PMONITOR->setSpecialWorkspace(nullptr);
+
// we need to make the PLASTWINDOW not equal to m_pLastWindow so that RENDERDATA is correct for an unfocused window
if (windowValidMapped(PLASTWINDOW)) {
PLASTWINDOW->updateDynamicRules();