diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-04-14 16:13:18 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-04-14 16:13:18 +0000 |
commit | 1162e823618dc2f4faa3f10d0dadc6e5cf741f97 (patch) | |
tree | 156a37b01ed19ed4993bb564a4352c00c9389170 /app/cwm | |
parent | fd966211d0808f21e2a14207100cee08ad90da25 (diff) |
only a window is required to set WM_STATE. also un-confuse xu_ptr_getpos
by using 'win' instead of 'rootwin' so as not to imply only the root
window is queried, rather any window.
Diffstat (limited to 'app/cwm')
-rw-r--r-- | app/cwm/calmwm.h | 4 | ||||
-rw-r--r-- | app/cwm/client.c | 4 | ||||
-rw-r--r-- | app/cwm/xutil.c | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 3f3feed9e..ef1c25648 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.187 2013/04/12 14:46:30 okan Exp $ + * $OpenBSD: calmwm.h,v 1.188 2013/04/14 16:13:17 okan Exp $ */ #ifndef _CALMWM_H_ @@ -466,7 +466,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(struct client_ctx *, int *); +int xu_getstate(Window, int *); int xu_getstrprop(Window, Atom, char **); void xu_key_grab(Window, int, int); void xu_key_ungrab(Window, int, int); diff --git a/app/cwm/client.c b/app/cwm/client.c index 51af7a693..e1b8b9173 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.124 2013/04/12 20:54:27 okan Exp $ + * $OpenBSD: client.c,v 1.125 2013/04/14 16:13:17 okan Exp $ */ #include <sys/param.h> @@ -111,7 +111,7 @@ client_new(Window win, struct screen_ctx *sc, int mapped) } client_draw_border(cc); - if (xu_getstate(cc, &state) < 0) + if (xu_getstate(cc->win, &state) < 0) state = NormalState; XSelectInput(X_Dpy, cc->win, ColormapChangeMask | EnterWindowMask | diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c index 4117adbb1..603e796ca 100644 --- a/app/cwm/xutil.c +++ b/app/cwm/xutil.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xutil.c,v 1.53 2013/04/10 19:08:09 okan Exp $ + * $OpenBSD: xutil.c,v 1.54 2013/04/14 16:13:17 okan Exp $ */ #include <sys/param.h> @@ -72,13 +72,13 @@ xu_btn_ungrab(Window win, int mask, u_int btn) } void -xu_ptr_getpos(Window rootwin, int *x, int *y) +xu_ptr_getpos(Window win, int *x, int *y) { Window w0, w1; int tmp0, tmp1; u_int tmp2; - XQueryPointer(X_Dpy, rootwin, &w0, &w1, &tmp0, &tmp1, x, y, &tmp2); + XQueryPointer(X_Dpy, win, &w0, &w1, &tmp0, &tmp1, x, y, &tmp2); } void @@ -203,11 +203,11 @@ xu_getstrprop(Window win, Atom atm, char **text) { } int -xu_getstate(struct client_ctx *cc, int *state) +xu_getstate(Window win, int *state) { long *p = NULL; - if (xu_getprop(cc->win, cwmh[WM_STATE].atom, cwmh[WM_STATE].atom, 2L, + if (xu_getprop(win, cwmh[WM_STATE].atom, cwmh[WM_STATE].atom, 2L, (u_char **)&p) <= 0) return (-1); |