Commit 3d57dbba authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(xm_popup_menu): Don't set XmNmenuPost unless

necessary.  From Rick Scott <rwscott@alumni.uwaterloo.ca>.
parent 30564c48
2001-03-13 Gerd Moellmann <gerd@gnu.org>
* lwlib-Xm.c (xm_popup_menu): Don't set XmNmenuPost unless
necessary. From Rick Scott <rwscott@alumni.uwaterloo.ca>.
2001-02-28 Gerd Moellmann <gerd@gnu.org>
* lwlib-Xm.c (xm_arm_callback): Don't compare widgets with `None',
......
......@@ -1728,19 +1728,29 @@ xm_popup_menu (widget, event)
if (event->type == ButtonPress || event->type == ButtonRelease)
{
/* This is so totally ridiculous: there's NO WAY to tell Motif
that *any* button can select a menu item. Only one button
can have that honor.
*/
char *trans = 0;
if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>";
else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>";
else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>";
else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>";
else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>";
if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL);
/* Setting the menuPost resource only required by Motif 1.1 and
LessTif 0.84 and earlier. With later versions of LessTif,
setting menuPost is unnecessary and may cause problems, so
don't do it. */
#if XmVersion < 1002 || (defined LESSTIF_VERSION && LESSTIF_VERSION < 84)
{
/* This is so totally ridiculous: there's NO WAY to tell Motif
that *any* button can select a menu item. Only one button
can have that honor. */
char *trans = 0;
if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>";
else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>";
else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>";
else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>";
else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>";
if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL);
}
#endif
XmMenuPosition (widget, (XButtonPressedEvent *) event);
}
XtManageChild (widget);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment