move ewmh_update_net_client_list() into ewmh.c

This commit is contained in:
Julien Danjou 2007-12-27 18:01:36 +01:00
parent 73691143af
commit 423659d401
3 changed files with 26 additions and 26 deletions

View File

@ -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

25
ewmh.c
View File

@ -22,7 +22,7 @@
#include <X11/Xatom.h>
#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

1
ewmh.h
View File

@ -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