diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-03-13 12:31:55 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-03-13 12:31:55 +0000 |
commit | 3d57dbba1d6ebe787a3a6fcd7b0a6a9e3d3d0e6e (patch) | |
tree | 04ca7b6ac85772cf6d020782cd298b8a983c3398 | |
parent | 30564c481041959f411f1e56bd95861c34db0a9c (diff) | |
download | emacs-3d57dbba1d6ebe787a3a6fcd7b0a6a9e3d3d0e6e.tar.gz |
(xm_popup_menu): Don't set XmNmenuPost unless
necessary. From Rick Scott <rwscott@alumni.uwaterloo.ca>.
-rw-r--r-- | lwlib/ChangeLog | 5 | ||||
-rw-r--r-- | lwlib/lwlib-Xm.c | 32 |
2 files changed, 26 insertions, 11 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index cdff50e5bcd..edde0e1aab6 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,8 @@ +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', 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); } |