Added a desktop ewmh atom

This commit is contained in:
vaxerski 2021-12-21 10:46:22 +01:00
parent 27e3258aa9
commit c4d2aef448
5 changed files with 19 additions and 0 deletions

View file

@ -178,5 +178,7 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
// EWMH to let everyone know // EWMH to let everyone know
EWMH::updateClientList(); EWMH::updateClientList();
EWMH::updateWindow(PWINDOW->getDrawable());
} }
} }

View file

@ -488,6 +488,7 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
// EWMH // EWMH
EWMH::updateClientList(); EWMH::updateClientList();
EWMH::setFrameExtents(E->window); EWMH::setFrameExtents(E->window);
EWMH::updateWindow(E->window);
} }
void Events::eventButtonPress(xcb_generic_event_t* event) { void Events::eventButtonPress(xcb_generic_event_t* event) {

View file

@ -113,3 +113,13 @@ void EWMH::updateDesktops() {
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_DESKTOP_NAMES"], HYPRATOMS["UTF8_STRING"], 8, msglen, names); xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_DESKTOP_NAMES"], HYPRATOMS["UTF8_STRING"], 8, msglen, names);
} }
} }
void EWMH::updateWindow(xcb_window_t win) {
const auto PWINDOW = g_pWindowManager->getWindowFromDrawable(win);
if (!PWINDOW || win < 1)
return;
const auto WORKSPACE = PWINDOW->getWorkspaceID();
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, win, HYPRATOMS["_NET_WM_DESKTOP"], XCB_ATOM_CARDINAL, 32, 1, &WORKSPACE);
}

View file

@ -5,6 +5,7 @@
namespace EWMH { namespace EWMH {
void setupInitEWMH(); void setupInitEWMH();
void updateCurrentWindow(xcb_window_t); void updateCurrentWindow(xcb_window_t);
void updateWindow(xcb_window_t);
void updateClientList(); void updateClientList();
void setFrameExtents(xcb_window_t); void setFrameExtents(xcb_window_t);
void refreshAllExtents(); void refreshAllExtents();

View file

@ -439,6 +439,9 @@ void CWindowManager::refreshDirtyWindows() {
} }
applyShapeToWindow(&window); applyShapeToWindow(&window);
// EWMH
EWMH::updateWindow(window.getDrawable());
} }
} }
@ -1834,6 +1837,8 @@ void CWindowManager::toggleWindowFullscrenn(const int& window) {
else else
removeAtom(window, HYPRATOMS["_NET_WM_STATE"], HYPRATOMS["_NET_WM_STATE_FULLSCREEN"]); removeAtom(window, HYPRATOMS["_NET_WM_STATE"], HYPRATOMS["_NET_WM_STATE_FULLSCREEN"]);
EWMH::updateWindow(window);
Debug::log(LOG, "Set fullscreen to " + std::to_string(PWINDOW->getFullscreen()) + " for " + std::to_string(window)); Debug::log(LOG, "Set fullscreen to " + std::to_string(PWINDOW->getFullscreen()) + " for " + std::to_string(window));
} }