changeset 9092:0033f98d2ffd

Clean up of temporary changes used to try to find a workaround for the X11R4 Xt bug whereby motion events are not generated from submenus.
author Paul Reilly <pmr@pajato.com>
date Sun, 25 Sep 1994 23:30:51 +0000
parents 557a04cd151b
children f8546f467db6
files lwlib/xlwmenu.c
diffstat 1 files changed, 10 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/xlwmenu.c	Sun Sep 25 20:46:44 1994 +0000
+++ b/lwlib/xlwmenu.c	Sun Sep 25 23:30:51 1994 +0000
@@ -30,8 +30,6 @@
 #include <X11/bitmaps/gray>
 #include "xlwmenuP.h"
 
-static int disable_add_grab, disable_grab_pointer;
-
 static int pointer_grabbed;
 static XEvent menu_post_event;
 
@@ -1289,10 +1287,8 @@
     set_new_state (mw, val, level);
   remap_menubar (mw);
   
-#if 1
   /* Sync with the display.  Makes it feel better on X terms. */
   XSync (XtDisplay (mw), False);
-#endif
 }
 
 static void
@@ -1307,7 +1303,6 @@
   handle_single_motion_event (mw, ev);
 
   /* allow motion events to be generated again */
-#if 0
   if (ev->is_hint
       && XQueryPointer (XtDisplay (mw), ev->window,
 			&ev->root, &ev->subwindow,
@@ -1317,14 +1312,6 @@
       && ev->state == state
       && (ev->x_root != x || ev->y_root != y))
     handle_single_motion_event (mw, ev);
-#else
-  XQueryPointer (XtDisplay (mw), ev->window,
-		 &ev->root, &ev->subwindow,
-		 &ev->x_root, &ev->y_root,
-		 &ev->x, &ev->y,
-		 &ev->state);
-  handle_single_motion_event (mw, ev);
-#endif
 }
 
 static void 
@@ -1457,8 +1444,7 @@
     {
       XEvent *ev = (XEvent *) event;
 
-      if (!disable_add_grab)
-	XtAddGrab ((Widget) mw, True, True);
+      XtAddGrab ((Widget) mw, True, True);
 
       /* notes the absolute position of the menubar window */
       mw->menu.windows [0].x = ev->xmotion.x_root - ev->xmotion.x;
@@ -1468,18 +1454,15 @@
 #ifdef emacs
   x_catch_errors ();
 #endif
-  if (!disable_grab_pointer)
-    {
-      XtGrabPointer ((Widget)mw, False,
-		     (PointerMotionMask
-		      | PointerMotionHintMask
-		      | ButtonReleaseMask
-		      | ButtonPressMask),
-		     GrabModeAsync, GrabModeAsync, None,
-		     mw->menu.cursor_shape,
-		     event->time);
-      pointer_grabbed = 1;
-    }
+  XtGrabPointer ((Widget)mw, False,
+		 (PointerMotionMask
+		  | PointerMotionHintMask
+		  | ButtonReleaseMask
+		  | ButtonPressMask),
+		 GrabModeAsync, GrabModeAsync, None,
+		 mw->menu.cursor_shape,
+		 event->time);
+  pointer_grabbed = 1;
 #ifdef emacs
   if (x_had_errors_p ())
     {
@@ -1491,13 +1474,3 @@
 
   handle_motion_event (mw, (XMotionEvent*)event);
 }
-
-void GetWindowAttributes (w)
-     Widget w;
-{
-  XWindowAttributes attrs;
-
-  XGetWindowAttributes (XtDisplay (w),
-			XtWindow (w),
-			&attrs);
-}