Submitted by CrystalCowboy on Thu, 12/03/2009 - 19:12. General Questions
A bug of interest to OpenMotif users & developers has appeared in Fedora 12. I believe the bug is in the X-windows server, but it affects an application which uses OpenMotif (or Lesstif). This bug was not present in earlier versions of Fedora, such as 9 and 11.
Briefly, when a button with a popup menu is clicked on, the menu pops up only if the tiny triangle indicating the popup menu is selected. If anywhere else on the button, no action occurs, and the mouse cursor becomes trapped within the bounds of the button.
The bug occurs whether the application is compiled with 32 or 64 bit OpenMotif, or 32 or 64 bit Lesstif. openmotif-2.3.2-5.fc12.x86_64 was installed through the RPMFusion repo.
The bug occurs when the X server (display) is running Fedora 12, and is insensitive to the version of the X client.
A work-around may be possible involving XmPOPUP_DISABLED.
See the bug posting at Red Hat Bugzilla Bug 543647, test code available there.
Yes, looks to me like a bug with the X-server as well. I posted my test case in the Bugzilla bug. I've been trying to find a good workaround as this bug is actually blocking my upgrade to Fedora 12. An large application we have requires a popup menu, and it is a bit to cumbersome to recode it to use X Toolkit popups.
One method I considered was downgrading the X-server on Fedora 12 until a real fix is found, but I'm not quite sure how to go about doing this.
In Fedora 12, I tried upgrading the X-server from 1.7.1-7.fc12 to 1.7.1-9.fc12 from the fedora-updates-testing repo, but it still has that bug. Although I should say that I'm not completely clear on which individual package contains the bug, so maybe I didn't update the right thing.
I updated the bugs, but we found a workaround if you want to try it out.
In some further testing, we've narrowed the problem down a bit to the XtGrabButton in RCPopup.C in the Xm library. When using motif to create a popup, using, for example XmCreatePopupMenu, it seems to use XtGrabButton. We found that if XtUngrabButton is called, the problem doesn't occur.
For example, a popup is created like so in example code:
menuRC = XmCreatePopupMenu(parent, (char*)(const char*)menuName, NULL, 0);
Then Ungrabbed immediately after:
for (i=0; i < ((_XmRowColumnRec *)menuRC)->row_column.postFromCount; i++)
{
XtUngrabButton( ((_XmRowColumnRec *)menuRC)->row_column.postFromList[i], AnyButton, AnyModifier);
}
Now the pop-up works with mouse button 3 correctly. I'm not sure what other effects this workaround would have, but it seems to be working for us so far.
Since the problem occurs in both Open Motif and Lesstif, does that implicate libXt?