From 296096596bb4943337367eb0b97b309f694d463d Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 8 Mar 2022 20:26:53 +0100 Subject: [PATCH] EWMH workspace coords --- src/ewmh/ewmh.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ewmh/ewmh.cpp b/src/ewmh/ewmh.cpp index 40aa9c7..7a487a1 100644 --- a/src/ewmh/ewmh.cpp +++ b/src/ewmh/ewmh.cpp @@ -111,6 +111,17 @@ 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); + + // Also update where the workspaces are so that bars and shit can read which monitor they belong to. + uint32_t workspaceCoords[ALLDESKTOPS * 2]; + + int pos = 0; + for (int i = 0; i < ALLDESKTOPS; ++i) { + workspaceCoords[pos++] = g_pWindowManager->monitors[g_pWindowManager->workspaces[i].getMonitor()].vecPosition.x; + workspaceCoords[pos++] = g_pWindowManager->monitors[g_pWindowManager->workspaces[i].getMonitor()].vecPosition.y; + } + + xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_DESKTOP_VIEWPORT"], XCB_ATOM_CARDINAL, 32, pos, &workspaceCoords); } }