Do not delete windows on unmap

This commit is contained in:
vaxerski 2022-03-09 14:59:04 +01:00
parent 940dca6c0a
commit 09fbb1e41a

View file

@ -151,23 +151,17 @@ void Events::eventUnmapWindow(xcb_generic_event_t* event) {
RETURNIFBAR; RETURNIFBAR;
Debug::log(LOG, "Unmap called on " + std::to_string(E->window));
const auto PCLOSEDWINDOW = g_pWindowManager->getWindowFromDrawable(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? return; // bullshit window?
}
if (PCLOSEDWINDOW->getIsFloating()) Debug::log(LOG, "Unmap called on " + std::to_string(E->window) + " -> " + PCLOSEDWINDOW->getName());
g_pWindowManager->moveWindowToUnmapped(E->window); // If it's floating, just unmap it.
else
g_pWindowManager->closeWindowAllChecks(E->window);
// refocus on new window // refocus on new window
g_pWindowManager->refocusWindowOnClosed(); g_pWindowManager->refocusWindowOnClosed();
// EWMH
EWMH::updateClientList();
} }
CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) { CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {