diff options
| author | Epilepsy Gatherings <73647246+phonetic112@users.noreply.github.com> | 2024-01-07 06:06:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-07 12:06:33 +0100 |
| commit | 666ee61c13e67e3a6943cd96157d9fb0967e596a (patch) | |
| tree | 86a2b0bd72ef4cafd3cdf24e6756b172935f9155 /src/Compositor.cpp | |
| parent | 7e033e48ace5406a9bc442f7d403f9ce3af193f3 (diff) | |
input: leave special on focus (#4358)
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 8 |
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(); |
