From ef1b78f4649612a9db2614abcfe968cdec13e139 Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 12 Apr 2013 20:45:57 +0000 Subject: we already set window state in client_hide or client_unhide right before, so there's no need to do it again. --- client.c | 1 - 1 file changed, 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index 1750360..663b7c5 100644 --- a/client.c +++ b/client.c @@ -125,7 +125,6 @@ client_new(Window win, struct screen_ctx *sc, int mapped) xu_configure(cc); (state == IconicState) ? client_hide(cc) : client_unhide(cc); - xu_setstate(cc, cc->state); TAILQ_INSERT_TAIL(&sc->mruq, cc, mru_entry); TAILQ_INSERT_TAIL(&Clientq, cc, entry); -- cgit 1.4.1 From f3dfc4968cee2080cfa4a4f24f0977b962aa367d Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 12 Apr 2013 20:54:27 +0000 Subject: we handle WM_STATE here, so remove misleading comment. --- client.c | 1 - 1 file changed, 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index 663b7c5..495625f 100644 --- a/client.c +++ b/client.c @@ -447,7 +447,6 @@ client_ptrsave(struct client_ctx *cc) void client_hide(struct client_ctx *cc) { - /* XXX - add wm_state stuff */ XUnmapWindow(X_Dpy, cc->win); cc->active = 0; -- cgit 1.4.1 From 16ed8bf8e4f561049b732b326f3d0ee475fe13f6 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 14 Apr 2013 16:13:17 +0000 Subject: 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. --- calmwm.h | 2 +- client.c | 2 +- xutil.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'client.c') diff --git a/calmwm.h b/calmwm.h index 86650ca..6f39aeb 100644 --- a/calmwm.h +++ b/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/client.c b/client.c index 495625f..932b4bc 100644 --- a/client.c +++ b/client.c @@ -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/xutil.c b/xutil.c index 3605e71..a663150 100644 --- a/xutil.c +++ b/xutil.c @@ -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); -- cgit 1.4.1