mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:25:58 +01:00
fix a crash in monitorDestroy
This commit is contained in:
parent
a0f3fc794e
commit
7b73570f11
1 changed files with 4 additions and 2 deletions
|
@ -319,14 +319,16 @@ void Events::listener_monitorDestroy(void* owner, void* data) {
|
||||||
|
|
||||||
// Cleanup everything. Move windows back, snap cursor, shit.
|
// Cleanup everything. Move windows back, snap cursor, shit.
|
||||||
const auto BACKUPMON = &g_pCompositor->m_lMonitors.front();
|
const auto BACKUPMON = &g_pCompositor->m_lMonitors.front();
|
||||||
const auto BACKUPWORKSPACE = BACKUPMON->activeWorkspace > 0 ? std::to_string(BACKUPMON->activeWorkspace) : "name:" + g_pCompositor->getWorkspaceByID(BACKUPMON->activeWorkspace)->m_szName;
|
|
||||||
|
|
||||||
if (!BACKUPMON) {
|
if (!BACKUPMON) {
|
||||||
Debug::log(CRIT, "No monitors! Unplugged last! Exiting.");
|
Debug::log(CRIT, "No monitors! Unplugged last! Exiting.");
|
||||||
g_pCompositor->cleanupExit();
|
g_pCompositor->cleanupExit();
|
||||||
|
exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto BACKUPWORKSPACE = BACKUPMON->activeWorkspace > 0 ? std::to_string(BACKUPMON->activeWorkspace) : "name:" + g_pCompositor->getWorkspaceByID(BACKUPMON->activeWorkspace)->m_szName;
|
||||||
|
|
||||||
// snap cursor
|
// snap cursor
|
||||||
wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, BACKUPMON->vecPosition.x + BACKUPMON->vecTransformedSize.x / 2.f, BACKUPMON->vecPosition.y + BACKUPMON->vecTransformedSize.y / 2.f);
|
wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, BACKUPMON->vecPosition.x + BACKUPMON->vecTransformedSize.x / 2.f, BACKUPMON->vecPosition.y + BACKUPMON->vecTransformedSize.y / 2.f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue