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);