mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-26 06:45:58 +01:00
Added a desktop ewmh atom
This commit is contained in:
parent
27e3258aa9
commit
c4d2aef448
5 changed files with 19 additions and 0 deletions
|
@ -178,5 +178,7 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
|
|||
|
||||
// EWMH to let everyone know
|
||||
EWMH::updateClientList();
|
||||
|
||||
EWMH::updateWindow(PWINDOW->getDrawable());
|
||||
}
|
||||
}
|
|
@ -488,6 +488,7 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
|
|||
// EWMH
|
||||
EWMH::updateClientList();
|
||||
EWMH::setFrameExtents(E->window);
|
||||
EWMH::updateWindow(E->window);
|
||||
}
|
||||
|
||||
void Events::eventButtonPress(xcb_generic_event_t* event) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
namespace EWMH {
|
||||
void setupInitEWMH();
|
||||
void updateCurrentWindow(xcb_window_t);
|
||||
void updateWindow(xcb_window_t);
|
||||
void updateClientList();
|
||||
void setFrameExtents(xcb_window_t);
|
||||
void refreshAllExtents();
|
||||
|
|
|
@ -439,6 +439,9 @@ void CWindowManager::refreshDirtyWindows() {
|
|||
}
|
||||
|
||||
applyShapeToWindow(&window);
|
||||
|
||||
// EWMH
|
||||
EWMH::updateWindow(window.getDrawable());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1834,6 +1837,8 @@ void CWindowManager::toggleWindowFullscrenn(const int& window) {
|
|||
else
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue