make floating windows on top on each new window

This commit is contained in:
vaxerski 2021-11-23 17:43:27 +01:00
parent fa221d5f05
commit 3a4c0e5bc6
3 changed files with 12 additions and 3 deletions

View file

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

View file

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

View file

@ -63,6 +63,7 @@ public:
bool isWorkspaceVisible(int workspaceID);
void setAllWindowsDirty();
void setAllFloatingWindowsTop();
SMonitor* getMonitorFromWindow(CWindow*);
SMonitor* getMonitorFromCursor();