From fb758cd44a2553799a395035572096f2b1a88691 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 12 Mar 2009 16:49:29 +0000 Subject: [PATCH] Set pager window properties Set a window name based on the requested workspace. Set _NET_WM_SKIP_PAGER on the pager window. --- pager.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pager.c b/pager.c index dc476c5..e7aa43a 100644 --- a/pager.c +++ b/pager.c @@ -56,6 +56,22 @@ void setup_atom(Atom *atom, const char *prop) { exit(111); } +/* Don't page the pager. */ +void setup_pager() { + long states = { skip_pager_state }; + char buffer[16]; + + XChangeProperty(DADisplay, DAWindow, client_state_atom, XA_ATOM, 32, PropModeAppend, &states, 1); + + if (desktop >= 0) { + if (snprintf(buffer, sizeof(buffer), "Desktop %d", desktop + 1) < 0) return; + } + else { + if (snprintf(buffer, sizeof(buffer), "All desktops") < 0) return; + } + XStoreName(DADisplay, DAWindow, buffer); +} + void get_atom_longs(Atom atom, Atom type, Window window, long **data, unsigned long *num_items) { Atom actual; int format; @@ -148,9 +164,6 @@ void enumerate_clients(client_t ***clients, unsigned long *num_clients, unsigned if (client_list_supported) client = data[i]; else client = XmuClientWindow(DADisplay, wins[i]); - /* Don't page the pager. */ - if (client == DAWindow) continue; - /* Check the window is on our desktop (or all desktops). */ client_desktop = get_atom_long(client_desktop_atom, XA_CARDINAL, client); if (desktop > -1) { @@ -439,6 +452,7 @@ int main(int argc, char **argv) { XSetErrorHandler(error_handler); setup_GCs(); + setup_pager(); DAShow(); DAEventLoop(); -- 2.20.1