aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-06-08 15:13:47 +0200
committervaxerski <[email protected]>2022-06-08 15:13:47 +0200
commit7b73570f11c61aa87b6052e5687dc612510ff575 (patch)
treeb8a3be2c65c0f5b455230838303d45bc93321b3d
parenta0f3fc794ede916b4bc9ae4cff02db9dac8ac630 (diff)
downloadHyprland-7b73570f11c61aa87b6052e5687dc612510ff575.tar.gz
Hyprland-7b73570f11c61aa87b6052e5687dc612510ff575.zip
fix a crash in monitorDestroy
-rw-r--r--src/events/Monitors.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp
index 0a7401de..7756bfa2 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -319,14 +319,16 @@ void Events::listener_monitorDestroy(void* owner, void* data) {
// Cleanup everything. Move windows back, snap cursor, shit.
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) {
Debug::log(CRIT, "No monitors! Unplugged last! Exiting.");
g_pCompositor->cleanupExit();
+ exit(1);
return;
}
+ const auto BACKUPWORKSPACE = BACKUPMON->activeWorkspace > 0 ? std::to_string(BACKUPMON->activeWorkspace) : "name:" + g_pCompositor->getWorkspaceByID(BACKUPMON->activeWorkspace)->m_szName;
+
// 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);