diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-03-13 12:31:36 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-03-13 12:31:36 +0000 |
commit | 46a258d2782cdf1e2ec0648c5176e247ddd79ae0 (patch) | |
tree | 6902f6af11d70ad66ae59f126c0775dc15fa3622 | |
parent | 86a6fc5b84d80ff10a9f165901f6b3ab1d76bfa2 (diff) | |
download | emacs-46a258d2782cdf1e2ec0648c5176e247ddd79ae0.tar.gz |
(xm_popup_menu): Don't set XmNmenuPost unless
necessary. From Rick Scott <rwscott@alumni.uwaterloo.ca>.
-rw-r--r-- | lwlib/lwlib-Xm.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 38142d79387..d380077717a 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -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); } |