From a67cbeac9416919fcf15ece5136d4e03fd124f87 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:48:41 +0100 Subject: [PATCH] support net client list stacking --- src/KeybindManager.cpp | 4 +++- src/ewmh/ewmh.cpp | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/KeybindManager.cpp b/src/KeybindManager.cpp index 02488c1..f7c6a81 100644 --- a/src/KeybindManager.cpp +++ b/src/KeybindManager.cpp @@ -175,6 +175,8 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) { PNEWWINDOW->setDefaultSize(RESTOREACSIZE); PNEWWINDOW->setCanKill(RESTORECANKILL); } - + + // EWMH to let everyone know + EWMH::updateClientList();git } } \ No newline at end of file diff --git a/src/ewmh/ewmh.cpp b/src/ewmh/ewmh.cpp index a449a07..93c8119 100644 --- a/src/ewmh/ewmh.cpp +++ b/src/ewmh/ewmh.cpp @@ -40,18 +40,26 @@ void EWMH::updateCurrentWindow(xcb_window_t w) { } void EWMH::updateClientList() { - std::vector windowsList; + std::vector tiledWindowsList; + std::vector floatedWindowsList; + for (auto& w : g_pWindowManager->windows) - if (w.getDrawable() > 0) - windowsList.push_back(w.getDrawable()); + if (w.getDrawable() > 0 && !w.getIsFloating()) + tiledWindowsList.push_back(w.getDrawable()); + else if (w.getDrawable() > 0) + floatedWindowsList.push_back(w.getDrawable()); for (auto& w : g_pWindowManager->unmappedWindows) - windowsList.push_back(w.getDrawable()); + floatedWindowsList.push_back(w.getDrawable()); // hack - xcb_window_t* ArrWindowList = &windowsList[0]; + xcb_window_t* ArrTiledWindowList = &tiledWindowsList[0]; + xcb_window_t* ArrFloatedWindowList = &floatedWindowsList[0]; xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_CLIENT_LIST"], XCB_ATOM_WINDOW, - 32, windowsList.size(), ArrWindowList); + 32, tiledWindowsList.size(), ArrTiledWindowList); + + xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_CLIENT_LIST_STACKING"], XCB_ATOM_WINDOW, + 32, floatedWindowsList.size(), ArrFloatedWindowList); } void EWMH::refreshAllExtents() {