From 46c9b5cbae1fca201b2ffdcc9e7d9ff0dcd7ed27 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 20 Mar 2010 20:13:27 +0000 Subject: Fix formatting errors breaking the xenocara mandoc(1) build: * .Bl may only have .It children * .SH requires an argument * blank lines are illegal outside literal context Now "cd /usr/xenocara && make man" succeeds, but unfortunately, that covers a minority of X11 manuals only. ok matthieu@ --- cwmrc.5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cwmrc.5 b/cwmrc.5 index 66537cb..4121274 100644 --- a/cwmrc.5 +++ b/cwmrc.5 @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 8 2009 $ +.Dd $Mdocdate: August 24 2009 $ .Dt CWMRC 5 .Os .Sh NAME @@ -166,7 +166,6 @@ The should be followed by number: .Pb .Bl -tag -width Ds -offset indent -compact -.Pp .It 1 Left mouse button. .It 2 -- cgit 1.4.1 From b12e6fc5cdba5683832ddaace84150ff6cc507a8 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 11 Apr 2010 16:51:26 +0000 Subject: clean up a few xu_* functions to just accept what they need (Window). ok oga@ --- calmwm.h | 5 ++--- client.c | 6 +++--- group.c | 2 +- xutil.c | 12 ++++++------ 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/calmwm.h b/calmwm.h index bb25ea6..173c7cb 100644 --- a/calmwm.h +++ b/calmwm.h @@ -399,9 +399,8 @@ void xu_ptr_setpos(Window, int, int); void xu_ptr_getpos(Window, int *, int *); void xu_key_grab(Window, int, int); void xu_key_ungrab(Window, int, int); -void xu_sendmsg(struct client_ctx *, Atom, long); -int xu_getprop(struct client_ctx *, Atom, Atom, long, - u_char **); +void xu_sendmsg(Window, Atom, long); +int xu_getprop(Window, Atom, Atom, long, u_char **); char *xu_getstrprop(struct client_ctx *, Atom atm); void xu_setstate(struct client_ctx *, int); int xu_getstate(struct client_ctx *, int *); diff --git a/client.c b/client.c index 46f9323..d2c89c9 100644 --- a/client.c +++ b/client.c @@ -495,7 +495,7 @@ client_update(struct client_ctx *cc) int i; long n; - if ((n = xu_getprop(cc, WM_PROTOCOLS, + if ((n = xu_getprop(cc->win, WM_PROTOCOLS, XA_ATOM, 20L, (u_char **)&p)) <= 0) return; @@ -512,7 +512,7 @@ void client_send_delete(struct client_ctx *cc) { if (cc->xproto & CLIENT_PROTO_DELETE) - xu_sendmsg(cc, WM_PROTOCOLS, WM_DELETE_WINDOW); + xu_sendmsg(cc->win, WM_PROTOCOLS, WM_DELETE_WINDOW); else XKillClient(X_Dpy, cc->win); } @@ -814,7 +814,7 @@ client_gethints(struct client_ctx *cc) cc->app_class = xch.res_class; } - if (xu_getprop(cc, _MOTIF_WM_HINTS, _MOTIF_WM_HINTS, + if (xu_getprop(cc->win, _MOTIF_WM_HINTS, _MOTIF_WM_HINTS, PROP_MWM_HINTS_ELEMENTS, (u_char **)&mwmh) == MWM_NUMHINTS) if (mwmh->flags & MWM_HINTS_DECORATIONS && !(mwmh->decorations & MWM_DECOR_ALL) && diff --git a/group.c b/group.c index f71ba06..d88484b 100644 --- a/group.c +++ b/group.c @@ -426,7 +426,7 @@ group_autogroup(struct client_ctx *cc) if (cc->app_class == NULL || cc->app_name == NULL) return; - if (xu_getprop(cc, _NET_WM_DESKTOP, XA_CARDINAL, + if (xu_getprop(cc->win, _NET_WM_DESKTOP, XA_CARDINAL, 1, (unsigned char **)&grpno) > 0) { if (*grpno == 0xffffffff) no = 0; diff --git a/xutil.c b/xutil.c index e59bc42..cbe7562 100644 --- a/xutil.c +++ b/xutil.c @@ -119,29 +119,29 @@ xu_key_ungrab(Window win, int mask, int keysym) } void -xu_sendmsg(struct client_ctx *cc, Atom atm, long val) +xu_sendmsg(Window win, Atom atm, long val) { XEvent e; memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; - e.xclient.window = cc->win; + e.xclient.window = win; e.xclient.message_type = atm; e.xclient.format = 32; e.xclient.data.l[0] = val; e.xclient.data.l[1] = CurrentTime; - XSendEvent(X_Dpy, cc->win, False, 0, &e); + XSendEvent(X_Dpy, win, False, 0, &e); } int -xu_getprop(struct client_ctx *cc, Atom atm, Atom type, long len, u_char **p) +xu_getprop(Window win, Atom atm, Atom type, long len, u_char **p) { Atom realtype; u_long n, extra; int format; - if (XGetWindowProperty(X_Dpy, cc->win, atm, 0L, len, False, type, + if (XGetWindowProperty(X_Dpy, win, atm, 0L, len, False, type, &realtype, &format, &n, &extra, p) != Success || *p == NULL) return (-1); @@ -156,7 +156,7 @@ xu_getstate(struct client_ctx *cc, int *state) { long *p = NULL; - if (xu_getprop(cc, WM_STATE, WM_STATE, 2L, (u_char **)&p) <= 0) + if (xu_getprop(cc->win, WM_STATE, WM_STATE, 2L, (u_char **)&p) <= 0) return (-1); *state = (int)*p; -- cgit 1.4.1 From a292c96977547511316acc8e20798f7c2b1edb19 Mon Sep 17 00:00:00 2001 From: oga Date: Mon, 12 Apr 2010 16:17:46 +0000 Subject: grab events on the root window *before* we look for existing windows. This closes a race we were hitting often where stuff started right before cwm may not get noticed and not have borders. ok okan@. Prompted by something todd noticed. --- calmwm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/calmwm.c b/calmwm.c index 2b4fdd9..09e006f 100644 --- a/calmwm.c +++ b/calmwm.c @@ -176,6 +176,12 @@ x_setupscreen(struct screen_ctx *sc, u_int which) xu_setwmname(sc); + rootattr.event_mask = ChildMask|PropertyChangeMask|EnterWindowMask| + LeaveWindowMask|ColormapChangeMask|ButtonMask; + + XChangeWindowAttributes(X_Dpy, sc->rootwin, + CWEventMask, &rootattr); + /* Deal with existing clients. */ XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins); @@ -190,12 +196,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which) screen_updatestackingorder(sc); - rootattr.event_mask = ChildMask|PropertyChangeMask|EnterWindowMask| - LeaveWindowMask|ColormapChangeMask|ButtonMask; - - XChangeWindowAttributes(X_Dpy, sc->rootwin, - CWEventMask, &rootattr); - if (XineramaQueryExtension(X_Dpy, &fake, &fake) == 1 && ((HasXinerama = XineramaIsActive(X_Dpy)) == 1)) HasXinerama = 1; -- cgit 1.4.1