From 09fbb1e41ac422892d58c79f51a14388b628284a Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:59:04 +0100 Subject: [PATCH] Do not delete windows on unmap --- src/events/events.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/events/events.cpp b/src/events/events.cpp index c63731d..49953df 100644 --- a/src/events/events.cpp +++ b/src/events/events.cpp @@ -151,23 +151,17 @@ void Events::eventUnmapWindow(xcb_generic_event_t* event) { RETURNIFBAR; - Debug::log(LOG, "Unmap called on " + std::to_string(E->window)); - const auto PCLOSEDWINDOW = g_pWindowManager->getWindowFromDrawable(E->window); - if (!PCLOSEDWINDOW) + if (!PCLOSEDWINDOW) { + Debug::log(LOG, "Unmap called on an invalid window: " + std::to_string(E->window)); return; // bullshit window? + } - if (PCLOSEDWINDOW->getIsFloating()) - g_pWindowManager->moveWindowToUnmapped(E->window); // If it's floating, just unmap it. - else - g_pWindowManager->closeWindowAllChecks(E->window); + Debug::log(LOG, "Unmap called on " + std::to_string(E->window) + " -> " + PCLOSEDWINDOW->getName()); // refocus on new window g_pWindowManager->refocusWindowOnClosed(); - - // EWMH - EWMH::updateClientList(); } CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {