From 6aa448534f8f6a731f9031d375ae3bf0a64f563c Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sat, 6 Aug 2022 21:10:37 +0200 Subject: [PATCH] guard toplevel funcs --- src/Window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Window.cpp b/src/Window.cpp index 176e8bb9..4b3fc59a 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -152,6 +152,9 @@ void CWindow::createToplevelHandle() { } void CWindow::destroyToplevelHandle() { + if (!m_phForeignToplevel) + return; + hyprListener_toplevelActivate.removeCallback(); hyprListener_toplevelClose.removeCallback(); hyprListener_toplevelFullscreen.removeCallback(); @@ -161,6 +164,9 @@ void CWindow::destroyToplevelHandle() { } void CWindow::updateToplevel() { + if (!m_phForeignToplevel) + return; + wlr_foreign_toplevel_handle_v1_set_app_id(m_phForeignToplevel, g_pXWaylandManager->getAppIDClass(this).c_str()); wlr_foreign_toplevel_handle_v1_set_title(m_phForeignToplevel, m_szTitle.c_str()); wlr_foreign_toplevel_handle_v1_set_fullscreen(m_phForeignToplevel, m_bIsFullscreen);