aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/events/Monitors.cpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-01-28 18:28:38 +0000
committervaxerski <[email protected]>2023-01-28 18:28:38 +0000
commitce632b7a05a27d121c9544607ccd873adee8bd42 (patch)
treef5b97514a3e8ccd4c1bf461d790613beaef53370 /src/events/Monitors.cpp
parent328e0344725aa9a9705fafc0817f3b825efef73e (diff)
downloadHyprland-ce632b7a05a27d121c9544607ccd873adee8bd42.tar.gz
Hyprland-ce632b7a05a27d121c9544607ccd873adee8bd42.zip
prevent early segfaults on default mouse posv0.21.0beta
Diffstat (limited to 'src/events/Monitors.cpp')
-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 1e199683..cb5bf274 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -94,8 +94,10 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
g_pCompositor->scheduleFrameForMonitor(PNEWMONITOR);
if (firstLaunch) {
- firstLaunch = false;
- g_pCompositor->warpCursorTo(PNEWMONITOR->vecPosition + PNEWMONITOR->vecSize / 2.f, true);
+ firstLaunch = false;
+ const auto POS = PNEWMONITOR->vecPosition + PNEWMONITOR->vecSize / 2.f;
+ if (g_pCompositor->m_sSeat.mouse)
+ wlr_cursor_warp(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, POS.x, POS.y);
}
}