mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 13:45:58 +01:00
moveActiveToWorkspace: update last window of old ws
This commit is contained in:
parent
086f724951
commit
088b4a68e6
1 changed files with 11 additions and 7 deletions
|
@ -880,21 +880,25 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
|
auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
|
||||||
|
CMonitor* pMonitor = nullptr;
|
||||||
|
const auto POLDWS = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
|
||||||
|
|
||||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||||
|
|
||||||
if (pWorkspace) {
|
if (pWorkspace) {
|
||||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
|
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID);
|
pMonitor = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID);
|
||||||
g_pCompositor->setActiveMonitor(PMONITOR);
|
g_pCompositor->setActiveMonitor(pMonitor);
|
||||||
PMONITOR->changeWorkspace(pWorkspace);
|
|
||||||
} else {
|
} else {
|
||||||
pWorkspace = g_pCompositor->createNewWorkspace(WORKSPACEID, PWINDOW->m_iMonitorID, workspaceName);
|
pWorkspace = g_pCompositor->createNewWorkspace(WORKSPACEID, PWINDOW->m_iMonitorID, workspaceName);
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID);
|
pMonitor = g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID);
|
||||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
|
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, pWorkspace);
|
||||||
PMONITOR->changeWorkspace(pWorkspace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POLDWS->m_pLastFocusedWindow = g_pCompositor->getFirstWindowOnWorkspace(POLDWS->m_iID);
|
||||||
|
|
||||||
|
pMonitor->changeWorkspace(pWorkspace);
|
||||||
|
|
||||||
g_pCompositor->focusWindow(PWINDOW);
|
g_pCompositor->focusWindow(PWINDOW);
|
||||||
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue