support net client list stacking

This commit is contained in:
vaxerski 2021-12-21 09:48:41 +01:00
parent 627d53ed7c
commit a67cbeac94
2 changed files with 17 additions and 7 deletions

View file

@ -176,5 +176,7 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
PNEWWINDOW->setCanKill(RESTORECANKILL); PNEWWINDOW->setCanKill(RESTORECANKILL);
} }
// EWMH to let everyone know
EWMH::updateClientList();git
} }
} }

View file

@ -40,18 +40,26 @@ void EWMH::updateCurrentWindow(xcb_window_t w) {
} }
void EWMH::updateClientList() { void EWMH::updateClientList() {
std::vector<xcb_window_t> windowsList; std::vector<xcb_window_t> tiledWindowsList;
std::vector<xcb_window_t> floatedWindowsList;
for (auto& w : g_pWindowManager->windows) for (auto& w : g_pWindowManager->windows)
if (w.getDrawable() > 0) if (w.getDrawable() > 0 && !w.getIsFloating())
windowsList.push_back(w.getDrawable()); tiledWindowsList.push_back(w.getDrawable());
else if (w.getDrawable() > 0)
floatedWindowsList.push_back(w.getDrawable());
for (auto& w : g_pWindowManager->unmappedWindows) for (auto& w : g_pWindowManager->unmappedWindows)
windowsList.push_back(w.getDrawable()); floatedWindowsList.push_back(w.getDrawable());
// hack // 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, 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() { void EWMH::refreshAllExtents() {