add support for _NET_CLIENT_LIST
This commit is contained in:
parent
0f4a9df88c
commit
c66c6dff84
|
@ -289,7 +289,7 @@ main(int argc, char *argv[])
|
||||||
Display * dpy;
|
Display * dpy;
|
||||||
int shape_event, randr_event_base;
|
int shape_event, randr_event_base;
|
||||||
int screen;
|
int screen;
|
||||||
enum { NetSupported, NetWMName, NetWMIcon, NetLast }; /* EWMH atoms */
|
enum { NetSupported, NetWMName, NetWMIcon, NetClientList, NetLast }; /* EWMH atoms */
|
||||||
Atom netatom[NetLast];
|
Atom netatom[NetLast];
|
||||||
event_handler **handler;
|
event_handler **handler;
|
||||||
struct sockaddr_un *addr;
|
struct sockaddr_un *addr;
|
||||||
|
@ -348,6 +348,7 @@ main(int argc, char *argv[])
|
||||||
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
netatom[NetWMIcon] = XInternAtom(dpy, "_NET_WM_ICON", False);
|
netatom[NetWMIcon] = XInternAtom(dpy, "_NET_WM_ICON", False);
|
||||||
|
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
||||||
|
|
||||||
/* do this only for real screen */
|
/* do this only for real screen */
|
||||||
for(screen = 0; screen < ScreenCount(dpy); screen++)
|
for(screen = 0; screen < ScreenCount(dpy); screen++)
|
||||||
|
|
27
client.c
27
client.c
|
@ -257,6 +257,31 @@ focus(Client *c, Bool selscreen, int screen)
|
||||||
RevertToPointerRoot, CurrentTime);
|
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
|
/** Manage a new client
|
||||||
* \param w The window
|
* \param w The window
|
||||||
* \param wa Window attributes
|
* \param wa Window attributes
|
||||||
|
@ -366,6 +391,8 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
|
||||||
|
|
||||||
focus(c, True, screen);
|
focus(c, True, screen);
|
||||||
|
|
||||||
|
ewmh_update_net_client_list(c->phys_screen);
|
||||||
|
|
||||||
/* rearrange to display new window */
|
/* rearrange to display new window */
|
||||||
arrange(screen);
|
arrange(screen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue