Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4fe23a
)
convert ewmh_get_win_state to XCB
author
David Hill
<dhill@conformal.com>
Wed, 4 Jul 2012 21:21:25 +0000
(17:21 -0400)
committer
Reginald Kennedy
<rk@rejii.com>
Fri, 20 Jul 2012 21:58:30 +0000
(
05:58
+0800)
spectrwm.c
patch
|
blob
|
history
diff --git
a/spectrwm.c
b/spectrwm.c
index
ea82b64
..
40e5a07
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-951,9
+951,10
@@
ewmh_update_win_state(struct ws_win *win, long state, long action)
void
ewmh_get_win_state(struct ws_win *win)
{
void
ewmh_get_win_state(struct ws_win *win)
{
- int success, i;
- unsigned long n;
- Atom *states;
+ xcb_atom_t *states;
+ xcb_get_property_cookie_t c;
+ xcb_get_property_reply_t *r;
+ int i, n;
if (win == NULL)
return;
if (win == NULL)
return;
@@
-964,16
+965,19
@@
ewmh_get_win_state(struct ws_win *win)
if (win->manual)
win->ewmh_flags |= SWM_F_MANUAL;
if (win->manual)
win->ewmh_flags |= SWM_F_MANUAL;
- success = get_property(win->id, ewmh[_NET_WM_STATE].atom,
- (~0L), XA_ATOM, &n, NULL, (void *)&states);
-
- if (!success)
+ c = xcb_get_property(conn, False, win->id, ewmh[_NET_WM_STATE].atom,
+ XCB_ATOM_ATOM, 0, (~0L));
+ r = xcb_get_property_reply(conn, c, NULL);
+ if (!r)
return;
return;
+
+ states = xcb_get_property_value(r);
+ n = xcb_get_property_value_length(r);
+
+ free(r);
for (i = 0; i < n; i++)
ewmh_update_win_state(win, states[i], _NET_WM_STATE_ADD);
for (i = 0; i < n; i++)
ewmh_update_win_state(win, states[i], _NET_WM_STATE_ADD);
-
- XFree(states);
}
/* events */
}
/* events */