tbetter mask handling, don't raise windows quite so eagerly. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 2c1b986edff846e76c1ae7b04a23807055293366
 (DIR) parent 2fc26be665bc4b3fb27187ccb326f6a28bd6b9c7
 (HTM) Author: rsc <devnull@localhost>
       Date:   Fri, 13 Aug 2004 13:57:58 +0000
       
       better mask handling, don't raise windows quite so eagerly.
       
       Diffstat:
         M src/cmd/rio/client.c                |       4 ++--
         M src/cmd/rio/event.c                 |      15 +++++++--------
         M src/cmd/rio/main.c                  |      15 ++++++++-------
       
       3 files changed, 17 insertions(+), 17 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/rio/client.c b/src/cmd/rio/client.c
       t@@ -23,11 +23,11 @@ setactive(Client *c, int on)
                        XUngrabButton(dpy, AnyButton, AnyModifier, c->parent);
                        XSetInputFocus(dpy, c->window, RevertToPointerRoot, timestamp());
                        if (c->proto & Ptakefocus)
       -                        sendcmessage(c->window, wm_protocols, wm_take_focus, 0, 0);
       +                        sendcmessage(c->window, wm_protocols, wm_take_focus, 0, 1);
                        cmapfocus(c);
                } else {
                        if (c->proto & Plosefocus)
       -                        sendcmessage(c->window, wm_protocols, wm_lose_focus, 0, 0);
       +                        sendcmessage(c->window, wm_protocols, wm_lose_focus, 0, 1);
                        XGrabButton(dpy, AnyButton, AnyModifier, c->parent, False,
                                ButtonMask, GrabModeAsync, GrabModeSync, None, None);
                }
 (DIR) diff --git a/src/cmd/rio/event.c b/src/cmd/rio/event.c
       t@@ -130,12 +130,6 @@ configurereq(XConfigureRequestEvent *e)
                        if (e->value_mask & CWBorderWidth)
                                c->border = e->border_width;
                        gravitate(c, 0);
       -                if (e->value_mask & CWStackMode) {
       -                        if (e->detail == Above)
       -                                top(c);
       -                        else
       -                                e->value_mask &= ~CWStackMode;
       -                }
                        if (c->parent != c->screen->root && c->window == e->window) {
                                wc.x = c->x-BORDER;
                                wc.y = c->y-BORDER;
       t@@ -146,8 +140,13 @@ configurereq(XConfigureRequestEvent *e)
                                wc.stack_mode = e->detail;
                                XConfigureWindow(dpy, c->parent, e->value_mask, &wc);
                                sendconfig(c);
       -                        top(c);        
       -                        active(c);
       +                }
       +                if (e->value_mask & CWStackMode) {
       +                        if (wc.stack_mode == Above) {
       +                                top(c);
       +                                active(c);
       +                        }else
       +                                e->value_mask &= ~CWStackMode;
                        }
                }
        
 (DIR) diff --git a/src/cmd/rio/main.c b/src/cmd/rio/main.c
       t@@ -411,13 +411,14 @@ sendcmessage(Window w, Atom a, long x, int isroot, int usemask)
                ev.xclient.format = 32;
                ev.xclient.data.l[0] = x;
                ev.xclient.data.l[1] = timestamp();
       -        if (usemask == 0)
       -                mask = 0;
       -        else if (isroot)
       -                mask = SubstructureRedirectMask;                /* magic! */
       -        else
       -                mask = ExposureMask;        /* not really correct but so be it */
       -        mask |= KeyPressMask;        /* seems to be necessary */
       +        mask = 0;
       +        if(usemask){
       +                mask |= KeyPressMask;        /* seems to be necessary */
       +                if (isroot)
       +                        mask |= SubstructureRedirectMask;                /* magic! */
       +                else
       +                        mask |= ExposureMask;        /* not really correct but so be it */
       +        }
                status = XSendEvent(dpy, w, False, mask, &ev);
                if (status == 0)
                        fprintf(stderr, "rio: sendcmessage failed\n");