From a92ec9a44e091d7e491acc2f98f2d9100c883fa6 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 24 Nov 2021 19:33:32 +0100 Subject: [PATCH] fixed a fatal error with default floating windows --- src/events/events.cpp | 4 ++-- src/windowManager.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/events/events.cpp b/src/events/events.cpp index 14059e7..8f1a4a7 100644 --- a/src/events/events.cpp +++ b/src/events/events.cpp @@ -84,7 +84,7 @@ CWindow* Events::remapFloatingWindow(int windowID) { // Add to arr g_pWindowManager->addWindowToVectorSafe(window); - Debug::log(LOG, "Created a new window! X: " + std::to_string(window.getPosition().x) + ", Y: " + std::to_string(window.getPosition().y) + ", W: " + std::to_string(window.getSize().x) + ", H:" + std::to_string(window.getSize().y) + " ID: " + std::to_string(windowID)); + Debug::log(LOG, "Created a new floating window! X: " + std::to_string(window.getPosition().x) + ", Y: " + std::to_string(window.getPosition().y) + ", W: " + std::to_string(window.getSize().x) + ", H:" + std::to_string(window.getSize().y) + " ID: " + std::to_string(windowID)); // Set map values g_pWindowManager->Values[0] = XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_FOCUS_CHANGE; @@ -183,7 +183,7 @@ CWindow* Events::remapWindow(int windowID, bool wasfloating) { // Add to arr g_pWindowManager->addWindowToVectorSafe(window); - Debug::log(LOG, "Created a new window! X: " + std::to_string(window.getPosition().x) + ", Y: " + std::to_string(window.getPosition().y) + ", W: " + std::to_string(window.getSize().x) + ", H:" + std::to_string(window.getSize().y) + " ID: " + std::to_string(windowID)); + Debug::log(LOG, "Created a new tiled window! X: " + std::to_string(window.getPosition().x) + ", Y: " + std::to_string(window.getPosition().y) + ", W: " + std::to_string(window.getSize().x) + ", H:" + std::to_string(window.getSize().y) + " ID: " + std::to_string(windowID)); // Set map values g_pWindowManager->Values[0] = XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_FOCUS_CHANGE; diff --git a/src/windowManager.cpp b/src/windowManager.cpp index e031bc9..4d0e922 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -619,6 +619,9 @@ void CWindowManager::calculateNewFloatingWindow(CWindow* pWindow) { pWindow->setPosition(pWindow->getDefaultPosition()); pWindow->setSize(pWindow->getDefaultSize()); + pWindow->setEffectivePosition(pWindow->getDefaultPosition()); + pWindow->setEffectiveSize(pWindow->getDefaultSize()); + Values[0] = XCB_STACK_MODE_ABOVE; xcb_configure_window(DisplayConnection, pWindow->getDrawable(), XCB_CONFIG_WINDOW_STACK_MODE, Values); }