mirror of
https://github.com/vale981/spectrwm
synced 2025-03-05 09:51:38 -05:00
make setup_ewmh() use xcb
This commit is contained in:
parent
e876d7de13
commit
376c5ec3f0
1 changed files with 27 additions and 11 deletions
38
spectrwm.c
38
spectrwm.c
|
@ -696,23 +696,39 @@ out:
|
||||||
void
|
void
|
||||||
setup_ewmh(void)
|
setup_ewmh(void)
|
||||||
{
|
{
|
||||||
int i,j;
|
xcb_atom_t sup_list;
|
||||||
Atom sup_list;
|
xcb_intern_atom_cookie_t c;
|
||||||
|
xcb_intern_atom_reply_t *r;
|
||||||
|
int i, j, num_screens;
|
||||||
|
|
||||||
sup_list = XInternAtom(display, "_NET_SUPPORTED", False);
|
c = xcb_intern_atom(conn, False, strlen("_NET_SUPPORTED"),
|
||||||
|
"_NET_SUPPORTED");
|
||||||
|
r = xcb_intern_atom_reply(conn, c, NULL);
|
||||||
|
if (r) {
|
||||||
|
sup_list = r->atom;
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < LENGTH(ewmh); i++) {
|
||||||
|
c = xcb_intern_atom(conn, False, strlen(ewmh[i].name),
|
||||||
|
ewmh[i].name);
|
||||||
|
r = xcb_intern_atom_reply(conn, c, NULL);
|
||||||
|
if (r) {
|
||||||
|
ewmh[i].atom = r->atom;
|
||||||
|
free(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < LENGTH(ewmh); i++)
|
num_screens = xcb_setup_roots_length(xcb_get_setup(conn));
|
||||||
ewmh[i].atom = XInternAtom(display, ewmh[i].name, False);
|
for (i = 0; i < num_screens; i++) {
|
||||||
|
|
||||||
for (i = 0; i < ScreenCount(display); i++) {
|
|
||||||
/* Support check window will be created by workaround(). */
|
/* Support check window will be created by workaround(). */
|
||||||
|
|
||||||
/* Report supported atoms */
|
/* Report supported atoms */
|
||||||
XDeleteProperty(display, screens[i].root, sup_list);
|
xcb_delete_property(conn, screens[i].root, sup_list);
|
||||||
for (j = 0; j < LENGTH(ewmh); j++)
|
for (j = 0; j < LENGTH(ewmh); j++)
|
||||||
XChangeProperty(display, screens[i].root,
|
xcb_change_property(conn, XCB_PROP_MODE_APPEND,
|
||||||
sup_list, XA_ATOM, 32,
|
screens[i].root, sup_list, XCB_ATOM_ATOM, 32, 1,
|
||||||
PropModeAppend, (unsigned char *)&ewmh[j].atom, 1);
|
&ewmh[j].atom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue