diff options
| author | memchr <118117622+memchr@users.noreply.github.com> | 2023-09-08 17:17:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-08 19:17:04 +0200 |
| commit | 664827473583f8e986f9fb2a37a13e9b3a232cc2 (patch) | |
| tree | edfb0d7a975fb33bb027522a57567a2a8091bff4 /src/Compositor.cpp | |
| parent | 398e861b554268e43e8af64ba72c682630302ec3 (diff) | |
fix: focusWindow on hidden workspace triggers another focusWindow. (#3216)
This commit address an issue where focusing a window on a hidden
workspace inadvertently triggered a second `focusWindow` call due to
simulated mouse movement. This behaviour led to the incorrect focus on
the window under the cursor instead of target window of method
`focusWindow()`, disrupting `focusurgentorlast` and `focuscurrentorlast`
dispatchers. Introduced a flag to the `CMonitor::changeWorkspace()`
method to prevent simulated mouse movements. This flag is set to false
by default. Changed the `focusWindow()` method accordingly to set this
flag to true when the target window is in a hidden workspace.
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index ea5faf63..a56a9249 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -878,7 +878,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID); PWORKSPACE->m_pLastFocusedWindow = pWindow; const auto PMONITOR = getMonitorFromID(PWORKSPACE->m_iMonitorID); - PMONITOR->changeWorkspace(PWORKSPACE); + PMONITOR->changeWorkspace(PWORKSPACE, false, true); // changeworkspace already calls focusWindow return; } |
