]> code.delx.au - gnu-emacs/commitdiff
(xm_popup_menu): Don't set XmNmenuPost unless
authorGerd Moellmann <gerd@gnu.org>
Tue, 13 Mar 2001 12:31:55 +0000 (12:31 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 13 Mar 2001 12:31:55 +0000 (12:31 +0000)
necessary.  From Rick Scott <rwscott@alumni.uwaterloo.ca>.

lwlib/ChangeLog
lwlib/lwlib-Xm.c

index cdff50e5bcdaf1bfc4751ea16c196a71ad22ac23..edde0e1aab6d3a780e3c5f5d394e7ff2e2ba5a5a 100644 (file)
@@ -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',
index 38142d79387e73e997aef019599c8e1ee1a3f0c5..d380077717acc0215a77dfcee0ec4cc14cc3a42c 100644 (file)
@@ -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);
 }