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

@ -175,6 +175,8 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
PNEWWINDOW->setDefaultSize(RESTOREACSIZE);
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() {
std::vector<xcb_window_t> windowsList;
std::vector<xcb_window_t> tiledWindowsList;
std::vector<xcb_window_t> 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() {