diff --git a/client.c b/client.c index 05789860..a655fe87 100644 --- a/client.c +++ b/client.c @@ -33,6 +33,7 @@ #include "statusbar.h" #include "window.h" #include "focus.h" +#include "ewmh.h" #include "layouts/floating.h" @@ -257,31 +258,6 @@ focus(Client *c, Bool selscreen, int screen) RevertToPointerRoot, CurrentTime); } -static void -ewmh_update_net_client_list(int phys_screen) -{ - Window *wins; - Client *c; - int n = 0; - - for(c = globalconf.clients; c; c = c->next) - if(c->phys_screen == phys_screen) - n++; - - wins = p_new(Window, n + 1); - - for(n = 0, c = globalconf.clients; c; c = c->next, n++) - if(c->phys_screen == phys_screen) - wins[n] = c->win; - - XChangeProperty(globalconf.display, RootWindow(globalconf.display, phys_screen), - XInternAtom(globalconf.display, "_NET_CLIENT_LIST", False), XA_WINDOW, 32, - PropModeReplace, (unsigned char*)wins, n); - - p_delete(&wins); - XFlush(globalconf.display); -} - /** Manage a new client * \param w The window * \param wa Window attributes diff --git a/ewmh.c b/ewmh.c index 2a7f0bce..74e8ad59 100644 --- a/ewmh.c +++ b/ewmh.c @@ -22,7 +22,7 @@ #include #include "ewmh.h" -#include "config.h" +#include "util.h" extern AwesomeConf globalconf; @@ -80,5 +80,28 @@ ewmh_set_supported_hints(int phys_screen) PropModeReplace, (unsigned char *) atom, i); } +void +ewmh_update_net_client_list(int phys_screen) +{ + Window *wins; + Client *c; + int n = 0; + + for(c = globalconf.clients; c; c = c->next) + if(c->phys_screen == phys_screen) + n++; + + wins = p_new(Window, n + 1); + + for(n = 0, c = globalconf.clients; c; c = c->next, n++) + if(c->phys_screen == phys_screen) + wins[n] = c->win; + + XChangeProperty(globalconf.display, RootWindow(globalconf.display, phys_screen), + net_client_list, XA_WINDOW, 32, PropModeReplace, (unsigned char *) wins, n); + + p_delete(&wins); + XFlush(globalconf.display); +} // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/ewmh.h b/ewmh.h index bef1fd79..ee526e3b 100644 --- a/ewmh.h +++ b/ewmh.h @@ -24,6 +24,7 @@ void ewmh_init_atoms(void); void ewmh_set_supported_hints(int); +void ewmh_update_net_client_list(int); #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80