From 302690624e29eddb506e4a377b59eac029128f3f Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 17 Apr 2013 13:52:20 +0000 Subject: slightly rework WM_STATE set/get to make it less ambigious; will be more clear on what needs to change to make it right in the end. --- xutil.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xutil.c') diff --git a/xutil.c b/xutil.c index a663150..8a22e21 100644 --- a/xutil.c +++ b/xutil.c @@ -218,15 +218,14 @@ xu_getstate(Window win, int *state) } void -xu_setstate(struct client_ctx *cc, int state) +xu_setstate(Window win, int state) { long dat[2]; dat[0] = state; dat[1] = None; - cc->state = state; - XChangeProperty(X_Dpy, cc->win, + XChangeProperty(X_Dpy, win, cwmh[WM_STATE].atom, cwmh[WM_STATE].atom, 32, PropModeReplace, (unsigned char *)dat, 2); } -- cgit 1.4.1 From 006a29e61773b02855e3c4e4a85d0e05f2837c6e Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 17 Apr 2013 13:57:06 +0000 Subject: mechanical xu_{get,set}state -> xu_{get,set}_wm_state change --- calmwm.h | 4 ++-- client.c | 10 +++++----- xutil.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'xutil.c') diff --git a/calmwm.h b/calmwm.h index ad8555a..4eb1e69 100644 --- a/calmwm.h +++ b/calmwm.h @@ -467,7 +467,7 @@ void xu_configure(struct client_ctx *); void xu_getatoms(void); unsigned long xu_getcolor(struct screen_ctx *, char *); int xu_getprop(Window, Atom, Atom, long, u_char **); -int xu_getstate(Window, int *); +int xu_get_wm_state(Window, int *); int xu_getstrprop(Window, Atom, char **); void xu_key_grab(Window, int, int); void xu_key_ungrab(Window, int, int); @@ -477,7 +477,7 @@ int xu_ptr_regrab(int, Cursor); void xu_ptr_setpos(Window, int, int); void xu_ptr_ungrab(void); void xu_sendmsg(Window, Atom, long); -void xu_setstate(Window win, int); +void xu_set_wm_state(Window win, int); void xu_xorcolor(XRenderColor, XRenderColor, XRenderColor *); diff --git a/client.c b/client.c index 01f4347..c8d3801 100644 --- a/client.c +++ b/client.c @@ -105,14 +105,14 @@ client_new(Window win, struct screen_ctx *sc, int mapped) if ((wmhints = XGetWMHints(X_Dpy, cc->win)) != NULL) { if (wmhints->flags & StateHint) { cc->state = wmhints->initial_state; - xu_setstate(cc->win, cc->state); + xu_set_wm_state(cc->win, cc->state); } XFree(wmhints); } } client_draw_border(cc); - if (xu_getstate(cc->win, &state) < 0) + if (xu_get_wm_state(cc->win, &state) < 0) state = NormalState; XSelectInput(X_Dpy, cc->win, ColormapChangeMask | EnterWindowMask | @@ -153,7 +153,7 @@ client_delete(struct client_ctx *cc) XGrabServer(X_Dpy); cc->state = WithdrawnState; - xu_setstate(cc->win, cc->state); + xu_set_wm_state(cc->win, cc->state); XRemoveFromSaveSet(X_Dpy, cc->win); XSync(X_Dpy, False); @@ -454,7 +454,7 @@ client_hide(struct client_ctx *cc) cc->active = 0; cc->flags |= CLIENT_HIDDEN; cc->state = IconicState; - xu_setstate(cc->win, cc->state); + xu_set_wm_state(cc->win, cc->state); if (cc == client_current()) client_none(cc->sc); @@ -467,7 +467,7 @@ client_unhide(struct client_ctx *cc) cc->flags &= ~CLIENT_HIDDEN; cc->state = NormalState; - xu_setstate(cc->win, cc->state); + xu_set_wm_state(cc->win, cc->state); client_draw_border(cc); } diff --git a/xutil.c b/xutil.c index 8a22e21..765b664 100644 --- a/xutil.c +++ b/xutil.c @@ -203,7 +203,7 @@ xu_getstrprop(Window win, Atom atm, char **text) { } int -xu_getstate(Window win, int *state) +xu_get_wm_state(Window win, int *state) { long *p = NULL; @@ -218,7 +218,7 @@ xu_getstate(Window win, int *state) } void -xu_setstate(Window win, int state) +xu_set_wm_state(Window win, int state) { long dat[2]; -- cgit 1.4.1