# HG changeset patch # User Gerd Moellmann # Date 984486696 0 # Node ID 93e2f21c32bdbf4256b43734631064e794b93a7e # Parent f23a696e7fd006d2be3f41922f9dbc2afdd931b2 (xm_popup_menu): Don't set XmNmenuPost unless necessary. From Rick Scott . diff -r f23a696e7fd0 -r 93e2f21c32bd lwlib/lwlib-Xm.c --- a/lwlib/lwlib-Xm.c Tue Mar 13 11:40:38 2001 +0000 +++ b/lwlib/lwlib-Xm.c Tue Mar 13 12:31:36 2001 +0000 @@ -1728,19 +1728,29 @@ 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 = ""; - else if (event->xbutton.state & Button4Mask) trans = ""; - else if (event->xbutton.state & Button3Mask) trans = ""; - else if (event->xbutton.state & Button2Mask) trans = ""; - else if (event->xbutton.state & Button1Mask) trans = ""; - 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 = ""; + else if (event->xbutton.state & Button4Mask) trans = ""; + else if (event->xbutton.state & Button3Mask) trans = ""; + else if (event->xbutton.state & Button2Mask) trans = ""; + else if (event->xbutton.state & Button1Mask) trans = ""; + if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL); + } +#endif + XmMenuPosition (widget, (XButtonPressedEvent *) event); } + XtManageChild (widget); }