Created
May 31, 2020 14:23
-
-
Save jD91mZM2/e7509de9a565b8b441736a37618b6ea6 to your computer and use it in GitHub Desktop.
workspace names - frankenwm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/frankenwm.c b/frankenwm.c | |
index 0bc3329..2bb2f08 100644 | |
--- a/frankenwm.c | |
+++ b/frankenwm.c | |
@@ -2859,6 +2859,7 @@ int setup(int default_screen) | |
xcb_atom_t net_atoms[] = { ewmh->_NET_SUPPORTED, | |
#ifdef EWMH_TASKBAR | |
ewmh->_NET_CLIENT_LIST, | |
+ ewmh->_NET_DESKTOP_NAMES, | |
ewmh->_NET_WM_STRUT, | |
ewmh->_NET_WM_STRUT_PARTIAL, | |
#endif /* EWMH_TASKBAR */ | |
@@ -3636,12 +3637,15 @@ int main(int argc, char *argv[]) | |
static void Setup_EWMH_Taskbar_Support(void) | |
{ | |
/* | |
- * initial _NET_CLIENT_LIST property | |
+ * Setup _NET_DESKTOP_NAMES | |
*/ | |
- Update_EWMH_Taskbar_Properties(); | |
- | |
xcb_change_property(dis, XCB_PROP_MODE_REPLACE, screen->root, | |
ewmh->_NET_DESKTOP_NAMES, ewmh->UTF8_STRING, 8, 0, NULL); | |
+ | |
+ /* | |
+ * initial _NET_CLIENT_LIST property | |
+ */ | |
+ Update_EWMH_Taskbar_Properties(); | |
} | |
static void Cleanup_EWMH_Taskbar_Support(void) | |
@@ -3684,6 +3688,13 @@ static inline void Update_EWMH_Taskbar_Properties(void) | |
free(wins); | |
DEBUGP("update _NET_CLIENT_LIST property (%d entries)\n", num); | |
} | |
+ | |
+ char *buffer = (char *)calloc(DESKTOPS, 18); | |
+ unsigned int next = 0; | |
+ for (desktop *d = (desktop *)get_head(&desktops); d; d = (desktop *)get_next(&d->link)) | |
+ next += sprintf(&buffer[next], "%d", d->num) + 1; | |
+ xcb_ewmh_set_desktop_names(ewmh, default_screen, next - 1, buffer); | |
+ free(buffer); | |
} | |
#endif /* EWMH_TASKBAR */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment