aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Reilly1994-09-25 23:30:51 +0000
committerPaul Reilly1994-09-25 23:30:51 +0000
commit87a559bff74112a031914cdf185cabbf8a019c0c (patch)
treea773a3c87ed2851907316dd3ba8ee0b5a2a7704a
parent31bcd4f55a890216c4cc4738bcf1a10578a7a7da (diff)
downloademacs-87a559bff74112a031914cdf185cabbf8a019c0c.tar.gz
emacs-87a559bff74112a031914cdf185cabbf8a019c0c.zip
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.
-rw-r--r--lwlib/xlwmenu.c47
1 files changed, 10 insertions, 37 deletions
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index 64763a8f10b..31773e1e001 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -30,8 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
30#include <X11/bitmaps/gray> 30#include <X11/bitmaps/gray>
31#include "xlwmenuP.h" 31#include "xlwmenuP.h"
32 32
33static int disable_add_grab, disable_grab_pointer;
34
35static int pointer_grabbed; 33static int pointer_grabbed;
36static XEvent menu_post_event; 34static XEvent menu_post_event;
37 35
@@ -1289,10 +1287,8 @@ handle_single_motion_event (mw, ev)
1289 set_new_state (mw, val, level); 1287 set_new_state (mw, val, level);
1290 remap_menubar (mw); 1288 remap_menubar (mw);
1291 1289
1292#if 1
1293 /* Sync with the display. Makes it feel better on X terms. */ 1290 /* Sync with the display. Makes it feel better on X terms. */
1294 XSync (XtDisplay (mw), False); 1291 XSync (XtDisplay (mw), False);
1295#endif
1296} 1292}
1297 1293
1298static void 1294static void
@@ -1307,7 +1303,6 @@ handle_motion_event (mw, ev)
1307 handle_single_motion_event (mw, ev); 1303 handle_single_motion_event (mw, ev);
1308 1304
1309 /* allow motion events to be generated again */ 1305 /* allow motion events to be generated again */
1310#if 0
1311 if (ev->is_hint 1306 if (ev->is_hint
1312 && XQueryPointer (XtDisplay (mw), ev->window, 1307 && XQueryPointer (XtDisplay (mw), ev->window,
1313 &ev->root, &ev->subwindow, 1308 &ev->root, &ev->subwindow,
@@ -1317,14 +1312,6 @@ handle_motion_event (mw, ev)
1317 && ev->state == state 1312 && ev->state == state
1318 && (ev->x_root != x || ev->y_root != y)) 1313 && (ev->x_root != x || ev->y_root != y))
1319 handle_single_motion_event (mw, ev); 1314 handle_single_motion_event (mw, ev);
1320#else
1321 XQueryPointer (XtDisplay (mw), ev->window,
1322 &ev->root, &ev->subwindow,
1323 &ev->x_root, &ev->y_root,
1324 &ev->x, &ev->y,
1325 &ev->state);
1326 handle_single_motion_event (mw, ev);
1327#endif
1328} 1315}
1329 1316
1330static void 1317static void
@@ -1457,8 +1444,7 @@ pop_up_menu (mw, event)
1457 { 1444 {
1458 XEvent *ev = (XEvent *) event; 1445 XEvent *ev = (XEvent *) event;
1459 1446
1460 if (!disable_add_grab) 1447 XtAddGrab ((Widget) mw, True, True);
1461 XtAddGrab ((Widget) mw, True, True);
1462 1448
1463 /* notes the absolute position of the menubar window */ 1449 /* notes the absolute position of the menubar window */
1464 mw->menu.windows [0].x = ev->xmotion.x_root - ev->xmotion.x; 1450 mw->menu.windows [0].x = ev->xmotion.x_root - ev->xmotion.x;
@@ -1468,18 +1454,15 @@ pop_up_menu (mw, event)
1468#ifdef emacs 1454#ifdef emacs
1469 x_catch_errors (); 1455 x_catch_errors ();
1470#endif 1456#endif
1471 if (!disable_grab_pointer) 1457 XtGrabPointer ((Widget)mw, False,
1472 { 1458 (PointerMotionMask
1473 XtGrabPointer ((Widget)mw, False, 1459 | PointerMotionHintMask
1474 (PointerMotionMask 1460 | ButtonReleaseMask
1475 | PointerMotionHintMask 1461 | ButtonPressMask),
1476 | ButtonReleaseMask 1462 GrabModeAsync, GrabModeAsync, None,
1477 | ButtonPressMask), 1463 mw->menu.cursor_shape,
1478 GrabModeAsync, GrabModeAsync, None, 1464 event->time);
1479 mw->menu.cursor_shape, 1465 pointer_grabbed = 1;
1480 event->time);
1481 pointer_grabbed = 1;
1482 }
1483#ifdef emacs 1466#ifdef emacs
1484 if (x_had_errors_p ()) 1467 if (x_had_errors_p ())
1485 { 1468 {
@@ -1491,13 +1474,3 @@ pop_up_menu (mw, event)
1491 1474
1492 handle_motion_event (mw, (XMotionEvent*)event); 1475 handle_motion_event (mw, (XMotionEvent*)event);
1493} 1476}
1494
1495void GetWindowAttributes (w)
1496 Widget w;
1497{
1498 XWindowAttributes attrs;
1499
1500 XGetWindowAttributes (XtDisplay (w),
1501 XtWindow (w),
1502 &attrs);
1503}