mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 20:25:59 +01:00
input: don't remove pinned focus on workspace change (#5486)
modified: src/helpers/Monitor.cpp
This commit is contained in:
parent
7d989f2cf0
commit
df1a3a978d
1 changed files with 14 additions and 9 deletions
|
@ -569,7 +569,8 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo
|
||||||
w->moveToWorkspace(pWorkspace);
|
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");
|
static auto PFOLLOWMOUSE = CConfigValue<Hyprlang::INT>("input:follow_mouse");
|
||||||
CWindow* pWindow = pWorkspace->getLastFocusedWindow();
|
CWindow* pWindow = pWorkspace->getLastFocusedWindow();
|
||||||
|
|
||||||
|
@ -627,10 +628,12 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) {
|
||||||
|
|
||||||
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
|
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
|
||||||
|
|
||||||
if (const auto PLAST = activeWorkspace->getLastFocusedWindow(); PLAST)
|
if (!(g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bPinned && g_pCompositor->m_pLastWindow->m_iMonitorID == ID)) {
|
||||||
g_pCompositor->focusWindow(PLAST);
|
if (const auto PLAST = activeWorkspace->getLastFocusedWindow(); PLAST)
|
||||||
else
|
g_pCompositor->focusWindow(PLAST);
|
||||||
g_pInputManager->refocus();
|
else
|
||||||
|
g_pInputManager->refocus();
|
||||||
|
}
|
||||||
|
|
||||||
g_pCompositor->updateFullscreenFadeOnWorkspace(activeWorkspace);
|
g_pCompositor->updateFullscreenFadeOnWorkspace(activeWorkspace);
|
||||||
|
|
||||||
|
@ -693,10 +696,12 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) {
|
||||||
|
|
||||||
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
|
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(ID);
|
||||||
|
|
||||||
if (const auto PLAST = pWorkspace->getLastFocusedWindow(); PLAST)
|
if (!(g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bPinned && g_pCompositor->m_pLastWindow->m_iMonitorID == ID)) {
|
||||||
g_pCompositor->focusWindow(PLAST);
|
if (const auto PLAST = pWorkspace->getLastFocusedWindow(); PLAST)
|
||||||
else
|
g_pCompositor->focusWindow(PLAST);
|
||||||
g_pInputManager->refocus();
|
else
|
||||||
|
g_pInputManager->refocus();
|
||||||
|
}
|
||||||
|
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", pWorkspace->m_szName + "," + szName});
|
g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", pWorkspace->m_szName + "," + szName});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue