From 51ce922ae1dac73181957bb0082a61d7467c19ba Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 21 Mar 2022 17:00:17 +0100 Subject: properly calc layers --- src/events/Windows.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index af468bd8..1a21b499 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -23,7 +23,14 @@ void Events::listener_mapWindow(wl_listener* listener, void* data) { PWINDOW->m_bMappedX11 = true; PWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace; - wl_signal_add(&g_pXWaylandManager->getWindowSurface(PWINDOW)->events.new_subsurface, &PWINDOW->listen_newSubsurfaceWindow); + const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(PWINDOW); + + if (!PWINDOWSURFACE) { + g_pCompositor->m_lWindows.remove(*PWINDOW); + return; + } + + wl_signal_add(&PWINDOWSURFACE->events.new_subsurface, &PWINDOW->listen_newSubsurfaceWindow); if (g_pXWaylandManager->shouldBeFloated(PWINDOW)) g_pLayoutManager->getCurrentLayout()->onWindowCreatedFloating(PWINDOW); -- cgit v1.2.3