X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=pager.c;fp=pager.c;h=e7aa43ac24d935c236b56600b8ed612e4ff92397;hb=fb758cd44a2553799a395035572096f2b1a88691;hp=dc476c5d2bca7f5c0c47349a341615e964df094c;hpb=53b2aae321aee06fb642d89f616123ea10f953b7;p=pager.git 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();