4 min read

Motif and Slackware 13.1

Unfortunately, there is a bug in X Windows that ships with Slackware64 13.1 which can cause programs which expect a certain behavior in X.org to freeze up. It's quite unpleasant. Fortunately, there is a patch that fixes the problem quite nicely. Here's the patch that I applied to my xorg-server package. This appears when you run the mwm window manager. What a drag.

Path: g2news1.google.com!news2.google.com!news3.google.com!goblin2!goblin.stu.neva.ru!csnews.cs.nctu.edu.tw!news.cs.nctu.edu.tw!ctu-peer!news.nctu.edu.tw!meganewsservers.com!feeder2.on.meganewsservers.com!news.uwaterloo.ca!server.example.net!not-for-mail
From: pab...@plg2.math.uwaterloo.ca (Peter A. Buhr)
Newsgroups: comp.windows.x.motif
Subject: Re: mwm
Date: Fri, 25 Jun 2010 07:54:53 -0400 (EDT)
Organization: University of Waterloo
Lines: 152
Message-ID: <i025ed$c85$1@plg2.math.uwaterloo.ca>
References: <hvjnv7$44a$1@rumours.uwaterloo.ca> <vfn3f7-049.ln1@news.anatron.com.au>
NNTP-Posting-Host: plg2.math.uwaterloo.ca
X-Trace: rumours.uwaterloo.ca 1277466893 8620 129.97.186.80 (25 Jun 2010 11:54:53 GMT)
X-Complaints-To: abuse@uwaterloo.ca
NNTP-Posting-Date: Fri, 25 Jun 2010 11:54:53 +0000 (UTC)

In article <vfn3f7-049....@news.anatron.com.au>,
Russell Shaw <rjshawN_o@s_pam.netspace.net.au> wrote:
>Peter A. Buhr wrote:
>> I have been using mwm for over 20 years. I just installed Ubuntu 10.4 on my
>> laptop and now when I press Alt-button1 in a window to raise the window
>> (defined in my .mwmrc file), mwm locks up and only allows input into the window
>> where I performed the Alt-button1.
>
>Ask in x...@lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/xorg

I did ask and it has moved on to this stage (see below). I don't know when the
patch will appear in distros. It appears to be have been a reasonably major bug
and many at xorg were glad it was found.

I'm pressing to my next problem with a bad interaction between mwm and
arcoread. I'll keep people here informed if I make any progress.

==============================================================================

Date: Fri, 25 Jun 2010 09:48:10 +1000
From: Peter Hutterer <peter.hutte...@who-t.net>
To: "X.Org Devel List" <xorg-de...@lists.freedesktop.org>
Cc: "Peter A. Buhr" <pab...@plg2.math.uwaterloo.ca>,
Keith Packard <kei...@keithp.com>,
Daniel Stone <dan...@freedesktop.org>
Subject: [PATCH] Revert "dix: use the event mask of the grab for
TryClientEvents."
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Behaviour of earlier X servers was to deliver the ButtonPress event
unconditionally, regardless of the actual event mask being set. Thus, a
GrabButton event will always deliver the button press event, a GrabKey
always the key press event, etc. Same goes for XI and XI2.

Reproducible with a simple client requesting a button grab in the form of:
XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, None);

On servers before MPX/XI2, the client will receive a button press and
release event. On current servers, the client receives only the release.
Clients that expect the press event to be delivered unconditionally may
leave the user with a stuck grab.

XTS test results for XGrabButton are identical with and without this patch.

This reverts commit 48585bd1e3e98db0f3df1ecc68022510216e00cc.

Conflicts:

dix/events.c

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

dix/events.c | 52 ++--------------------------------------------------
1 files changed, 2 insertions(+), 50 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index ae9847c..e1c3d0a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3420,7 +3420,6 @@ CheckPassiveGrabsOnWindow(
{
DeviceIntPtr gdev;
XkbSrvInfoPtr xkbi = NULL;

  • Mask mask = 0;

    gdev= grab->modifierDevice;
    if (grab->grabtype == GRABTYPE_CORE)
    @@ -3535,9 +3534,6 @@ CheckPassiveGrabsOnWindow(
    }
    xE = &core;
    count = 1;

  •            mask = grab-&gt;eventMask;
    
  •            if (grab-&gt;ownerEvents)
    
  •                mask |= pWin-&gt;eventMask;
           } else if (match &amp; XI2_MATCH)
           {
               rc = EventToXI2((InternalEvent*)event, &amp;xE);
    

@@ -3549,34 +3545,6 @@ CheckPassiveGrabsOnWindow(
continue;
}
count = 1;

  •            /* FIXME: EventToXI2 returns NULL for enter events, so
    
  •             * dereferencing the event is bad. Internal event types are
    
  •             * aligned with core events, so the else clause is valid.
    
  •             * long-term we should use internal events for enter/focus
    
  •             * as well */
    
  •            if (xE)
    
  •                mask = grab-&gt;xi2mask[device-&gt;id][((xGenericEvent*)xE)-&gt;evtype/8];
    
  •            else if (event-&gt;type == XI_Enter || event-&gt;type == XI_FocusIn)
    
  •                mask = grab-&gt;xi2mask[device-&gt;id][event-&gt;type/8];
    
  •            if (grab-&gt;ownerEvents &amp;&amp; wOtherInputMasks(grab-&gt;window))
    
  •            {
    
  •                InputClientsPtr icp =
    
  •                    wOtherInputMasks(grab-&gt;window)-&gt;inputClients;
    
  •                while(icp)
    
  •                {
    
  •                    if (rClient(icp) == rClient(grab))
    
  •                    {
    
  •                        int evtype = (xE) ? ((xGenericEvent*)xE)-&gt;evtype : event-&gt;type;
    
  •                        mask |= icp-&gt;xi2mask[device-&gt;id][evtype/8];
    
  •                        break;
    
  •                    }
    
  •                    icp = icp-&gt;next;
    
  •                }
    
  •            }
           } else
           {
               rc = EventToXI((InternalEvent*)event, &amp;xE, &amp;count);
    

@@ -3587,23 +3555,6 @@ CheckPassiveGrabsOnWindow(
"(%d, %d).n", device->name, event->type, rc);
continue;
}

  •            mask = grab-&gt;eventMask;
    
  •            if (grab-&gt;ownerEvents &amp;&amp; wOtherInputMasks(grab-&gt;window))
    
  •            {
    
  •                InputClientsPtr icp =
    
  •                    wOtherInputMasks(grab-&gt;window)-&gt;inputClients;
    
  •                while(icp)
    
  •                {
    
  •                    if (rClient(icp) == rClient(grab))
    
  •                    {
    
  •                        mask |= icp-&gt;mask[device-&gt;id];
    
  •                        break;
    
  •                    }
    
  •                    icp = icp-&gt;next;
    
  •                }
    
  •            }
           }
    
      (*grabinfo-&gt;ActivateGrab)(device, grab, currentTime, TRUE);
    

@@ -3612,7 +3563,8 @@ CheckPassiveGrabsOnWindow(
{
FixUpEventFromWindow(device, xE, grab->window, None, TRUE);

  •            TryClientEvents(rClient(grab), device, xE, count, mask,
    
  •            TryClientEvents(rClient(grab), device, xE, count,
    
  •                                   GetEventFilter(device, xE),
                                      GetEventFilter(device, xE), grab);
           }
    

--
1.7.1