Commit 87a559bf authored by Paul Reilly's avatar Paul Reilly

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.
parent 31bcd4f5
...@@ -30,8 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -30,8 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <X11/bitmaps/gray> #include <X11/bitmaps/gray>
#include "xlwmenuP.h" #include "xlwmenuP.h"
static int disable_add_grab, disable_grab_pointer;
static int pointer_grabbed; static int pointer_grabbed;
static XEvent menu_post_event; static XEvent menu_post_event;
...@@ -1289,10 +1287,8 @@ handle_single_motion_event (mw, ev) ...@@ -1289,10 +1287,8 @@ handle_single_motion_event (mw, ev)
set_new_state (mw, val, level); set_new_state (mw, val, level);
remap_menubar (mw); remap_menubar (mw);
#if 1
/* Sync with the display. Makes it feel better on X terms. */ /* Sync with the display. Makes it feel better on X terms. */
XSync (XtDisplay (mw), False); XSync (XtDisplay (mw), False);
#endif
} }
static void static void
...@@ -1307,7 +1303,6 @@ handle_motion_event (mw, ev) ...@@ -1307,7 +1303,6 @@ handle_motion_event (mw, ev)
handle_single_motion_event (mw, ev); handle_single_motion_event (mw, ev);
/* allow motion events to be generated again */ /* allow motion events to be generated again */
#if 0
if (ev->is_hint if (ev->is_hint
&& XQueryPointer (XtDisplay (mw), ev->window, && XQueryPointer (XtDisplay (mw), ev->window,
&ev->root, &ev->subwindow, &ev->root, &ev->subwindow,
...@@ -1317,14 +1312,6 @@ handle_motion_event (mw, ev) ...@@ -1317,14 +1312,6 @@ handle_motion_event (mw, ev)
&& ev->state == state && ev->state == state
&& (ev->x_root != x || ev->y_root != y)) && (ev->x_root != x || ev->y_root != y))
handle_single_motion_event (mw, ev); 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 static void
...@@ -1457,8 +1444,7 @@ pop_up_menu (mw, event) ...@@ -1457,8 +1444,7 @@ pop_up_menu (mw, event)
{ {
XEvent *ev = (XEvent *) event; 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 */ /* notes the absolute position of the menubar window */
mw->menu.windows [0].x = ev->xmotion.x_root - ev->xmotion.x; mw->menu.windows [0].x = ev->xmotion.x_root - ev->xmotion.x;
...@@ -1468,18 +1454,15 @@ pop_up_menu (mw, event) ...@@ -1468,18 +1454,15 @@ pop_up_menu (mw, event)
#ifdef emacs #ifdef emacs
x_catch_errors (); x_catch_errors ();
#endif #endif
if (!disable_grab_pointer) XtGrabPointer ((Widget)mw, False,
{ (PointerMotionMask
XtGrabPointer ((Widget)mw, False, | PointerMotionHintMask
(PointerMotionMask | ButtonReleaseMask
| PointerMotionHintMask | ButtonPressMask),
| ButtonReleaseMask GrabModeAsync, GrabModeAsync, None,
| ButtonPressMask), mw->menu.cursor_shape,
GrabModeAsync, GrabModeAsync, None, event->time);
mw->menu.cursor_shape, pointer_grabbed = 1;
event->time);
pointer_grabbed = 1;
}
#ifdef emacs #ifdef emacs
if (x_had_errors_p ()) if (x_had_errors_p ())
{ {
...@@ -1491,13 +1474,3 @@ pop_up_menu (mw, event) ...@@ -1491,13 +1474,3 @@ pop_up_menu (mw, event)
handle_motion_event (mw, (XMotionEvent*)event); handle_motion_event (mw, (XMotionEvent*)event);
} }
void GetWindowAttributes (w)
Widget w;
{
XWindowAttributes attrs;
XGetWindowAttributes (XtDisplay (w),
XtWindow (w),
&attrs);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment