diff --git a/src/events/events.cpp b/src/events/events.cpp index 0a89b80..b1e6499 100644 --- a/src/events/events.cpp +++ b/src/events/events.cpp @@ -128,9 +128,8 @@ CWindow* Events::remapWindow(int windowID, bool wasfloating) { g_pWindowManager->setFocusedWindow(windowID); - float values[1]; - values[0] = XCB_STACK_MODE_BELOW; - xcb_configure_window(g_pWindowManager->DisplayConnection, windowID, XCB_CONFIG_WINDOW_STACK_MODE, values); + // Make all floating windows above + g_pWindowManager->setAllFloatingWindowsTop(); return g_pWindowManager->getWindowFromDrawable(windowID); } diff --git a/src/windowManager.cpp b/src/windowManager.cpp index 6bcf46d..8a10ea7 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -900,3 +900,12 @@ void CWindowManager::updateBarInfo() { statusBar.setCurrentWorkspace(activeWorkspaces[getMonitorFromCursor()->ID]); } + +void CWindowManager::setAllFloatingWindowsTop() { + for (auto& window : windows) { + if (window.getIsFloating()) { + Values[0] = XCB_STACK_MODE_ABOVE; + xcb_configure_window(g_pWindowManager->DisplayConnection, window.getDrawable(), XCB_CONFIG_WINDOW_STACK_MODE, Values); + } + } +} \ No newline at end of file diff --git a/src/windowManager.hpp b/src/windowManager.hpp index 4fb4dde..794e3b2 100644 --- a/src/windowManager.hpp +++ b/src/windowManager.hpp @@ -63,6 +63,7 @@ public: bool isWorkspaceVisible(int workspaceID); void setAllWindowsDirty(); + void setAllFloatingWindowsTop(); SMonitor* getMonitorFromWindow(CWindow*); SMonitor* getMonitorFromCursor();