[Xastir-dev] Long-standing NumLock/CapsLock/ScrollLock bug fixed

Curt, WE7U archer at eskimo.com
Wed Dec 8 11:16:31 EST 2004


As near as I can tell, the bug having to do with the X11 modifiers
has been fixed!  It was checked into CVS early this morning, so it
might be another few hours before it'll show up on anonymous CVS.

This is the bug where the NumLock/CapsLock/ScrollLock keys would
prevent the right-click menu from appearing.  Eventually, if I get
enough glowing reports about this fix, I should be able to remove
the modifier warning code and togglebutton from Configure->Defaults
and we can forget about this chapter of Xastir's history.

Thanks to Lance Cotton, kj5o for helping out during a long debug
session last night.  We honed in on the correct section of code
after a while, but he's the one that found the bug listing on the
Motif site that pulled it all together/pointed us to the correct
fix.

It turns out Motif 2.x has a bug in the XmNmenuPost option.  If you
revert to the Motif 1.x method of doing things (XmNwhichButton), it
works great.

Lance pointed out that we're seeing a zoom rectangle now when we
bring up that menu, but that's a more minor bug (in my book) and
we can tackle that one later.

So that people with similar problems in other Motif programs can
find this problem/solution via Google, here's the section of code
we're dealing with.  The "XmNmenuPost" lines have been commented out
and replaced with "XmNwhichButton" lines:


#ifdef SWAP_MOUSE_BUTTONS
    //
    // Motif 2.2.2 (and perhaps earlier, back to version 2.0) has a
    // problem where the XmNmenuPost doesn't work properly for
    // modifiers (CapsLock/ScrollLock/NumLock/etc).  We're reverting
    // back to the Motif 1.x method of doing things.  It works!
    //
    //XtSetArg(al[ac], XmNmenuPost, "<Btn1Down>"); ac++;  // Set for popup menu on button 1
    XtSetArg(al[ac], XmNwhichButton, 1); ac++;  // Enable popup menu on button 1

#else   // SWAP_MOUSE_BUTTONS
    //
    // Motif 2.2.2 (and perhaps earlier, back to version 2.0) has a
    // problem where the XmNmenuPost doesn't work properly for
    // modifiers (CapsLock/ScrollLock/NumLock/etc).  We're reverting
    // back to the Motif 1.x method of doing things.  It works!
    //
    //XtSetArg(al[ac], XmNmenuPost, "<Btn3Down>"); ac++;  // Set for popup menu on button 3
    XtSetArg(al[ac], XmNwhichButton, 3); ac++;  // Enable popup menu on button 3
#endif  // SWAP_MOUSE_BUTTONS


--
Curt, WE7U.   APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Xastir-dev mailing list