diff options
| -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 @@ | |||
| 1 | 2001-03-13 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * lwlib-Xm.c (xm_popup_menu): Don't set XmNmenuPost unless | ||
| 4 | necessary. From Rick Scott <rwscott@alumni.uwaterloo.ca>. | ||
| 5 | |||
| 1 | 2001-02-28 Gerd Moellmann <gerd@gnu.org> | 6 | 2001-02-28 Gerd Moellmann <gerd@gnu.org> |
| 2 | 7 | ||
| 3 | * lwlib-Xm.c (xm_arm_callback): Don't compare widgets with `None', | 8 | * 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) | |||
| 1728 | 1728 | ||
| 1729 | if (event->type == ButtonPress || event->type == ButtonRelease) | 1729 | if (event->type == ButtonPress || event->type == ButtonRelease) |
| 1730 | { | 1730 | { |
| 1731 | /* This is so totally ridiculous: there's NO WAY to tell Motif | 1731 | /* Setting the menuPost resource only required by Motif 1.1 and |
| 1732 | that *any* button can select a menu item. Only one button | 1732 | LessTif 0.84 and earlier. With later versions of LessTif, |
| 1733 | can have that honor. | 1733 | setting menuPost is unnecessary and may cause problems, so |
| 1734 | */ | 1734 | don't do it. */ |
| 1735 | char *trans = 0; | 1735 | #if XmVersion < 1002 || (defined LESSTIF_VERSION && LESSTIF_VERSION < 84) |
| 1736 | if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>"; | 1736 | { |
| 1737 | else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>"; | 1737 | /* This is so totally ridiculous: there's NO WAY to tell Motif |
| 1738 | else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>"; | 1738 | that *any* button can select a menu item. Only one button |
| 1739 | else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>"; | 1739 | can have that honor. */ |
| 1740 | else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>"; | 1740 | |
| 1741 | if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL); | 1741 | char *trans = 0; |
| 1742 | if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>"; | ||
| 1743 | else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>"; | ||
| 1744 | else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>"; | ||
| 1745 | else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>"; | ||
| 1746 | else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>"; | ||
| 1747 | if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL); | ||
| 1748 | } | ||
| 1749 | #endif | ||
| 1750 | |||
| 1742 | XmMenuPosition (widget, (XButtonPressedEvent *) event); | 1751 | XmMenuPosition (widget, (XButtonPressedEvent *) event); |
| 1743 | } | 1752 | } |
| 1753 | |||
| 1744 | XtManageChild (widget); | 1754 | XtManageChild (widget); |
| 1745 | } | 1755 | } |
| 1746 | 1756 | ||