mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-12-26 03:09:49 +01:00
fix incorrect opens when focused on different monitor
This commit is contained in:
parent
fb190885d9
commit
d8c819fe7f
1 changed files with 5 additions and 0 deletions
|
@ -462,6 +462,11 @@ CWindow* Events::remapWindow(int windowID, bool wasfloating, int forcemonitor) {
|
|||
}
|
||||
}
|
||||
|
||||
if (g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow) && forcemonitor == -1 && PMONITOR->ID != g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow)->getMonitor()) {
|
||||
// If the monitor of the last window doesnt match the current screen force the monitor of the cursor
|
||||
forcemonitor = PMONITOR->ID;
|
||||
}
|
||||
|
||||
const auto CURRENTSCREEN = forcemonitor != -1 ? forcemonitor : PMONITOR->ID;
|
||||
PWINDOWINARR->setWorkspaceID(g_pWindowManager->activeWorkspaces[CURRENTSCREEN]);
|
||||
PWINDOWINARR->setMonitor(CURRENTSCREEN);
|
||||
|
|
Loading…
Reference in a new issue