aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMightyPlaza <[email protected]>2024-04-07 22:13:56 +0000
committerGitHub <[email protected]>2024-04-07 23:13:56 +0100
commitdf1a3a978d61b976542beaadc7c0ab8468ddb5d0 (patch)
tree6f87a2e56325261057e1f551a5448db873a5cd87
parent7d989f2cf0ef3d14aa2cc3a03bc05ddf2265b6d1 (diff)
downloadHyprland-df1a3a978d61b976542beaadc7c0ab8468ddb5d0.tar.gz
Hyprland-df1a3a978d61b976542beaadc7c0ab8468ddb5d0.zip
input: don't remove pinned focus on workspace change (#5486)
modified: src/helpers/Monitor.cpp
-rw-r--r--src/helpers/Monitor.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 74b77b98..83d0db0f 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -569,7 +569,8 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo
w->moveToWorkspace(pWorkspace);
}
- if (!noFocus && !g_pCompositor->m_pLastMonitor->activeSpecialWorkspace) {
+ if (!noFocus && !g_pCompositor->m_pLastMonitor->activeSpecialWorkspace &&
+ !(g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bPinned && g_pCompositor->m_pLastWindow->m_iMonitorID == ID)) {
static auto PFOLLOWMOUSE = CConfigValue<Hyprlang::INT>("input:follow_mouse");
CWindow* pWindow = pWorkspace->getLastFocusedWindow();
@@ -627,10 +628,12 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) {
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
- if (const auto PLAST = activeWorkspace->getLastFocusedWindow(); PLAST)
- g_pCompositor->focusWindow(PLAST);
- else
- g_pInputManager->refocus();
+ if (!(g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bPinned && g_pCompositor->m_pLastWindow->m_iMonitorID == ID)) {
+ if (const auto PLAST = activeWorkspace->getLastFocusedWindow(); PLAST)
+ g_pCompositor->focusWindow(PLAST);
+ else
+ g_pInputManager->refocus();
+ }
g_pCompositor->updateFullscreenFadeOnWorkspace(activeWorkspace);
@@ -693,10 +696,12 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) {
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
- if (const auto PLAST = pWorkspace->getLastFocusedWindow(); PLAST)
- g_pCompositor->focusWindow(PLAST);
- else
- g_pInputManager->refocus();
+ if (!(g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bPinned && g_pCompositor->m_pLastWindow->m_iMonitorID == ID)) {
+ if (const auto PLAST = pWorkspace->getLastFocusedWindow(); PLAST)
+ g_pCompositor->focusWindow(PLAST);
+ else
+ g_pInputManager->refocus();
+ }
g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", pWorkspace->m_szName + "," + szName});