changeset 1040:5323022ae863

[xemacs-hg @ 2002-10-08 04:50:00 by youngs] 2002-08-20 Ben Sigelman <bhsigelm@cs.brown.edu> * event-Xt.c (drain_X_queue): loop over while(XEventsQueued()) instead of while(XtAppPending()&XtIMXEvent). Upon a gdm logout, the xemacs process did not exit, but looped infinitely here. This fixes that problem.
author youngs
date Tue, 08 Oct 2002 04:50:08 +0000
parents a97af4f94589
children ffabf70273fe
files src/ChangeLog src/event-Xt.c
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Oct 08 03:45:12 2002 +0000
+++ b/src/ChangeLog	Tue Oct 08 04:50:08 2002 +0000
@@ -1,3 +1,10 @@
+2002-08-20  Ben Sigelman  <bhsigelm@cs.brown.edu>
+
+	* event-Xt.c (drain_X_queue): loop over while(XEventsQueued())
+	instead of while(XtAppPending()&XtIMXEvent).  Upon a gdm logout,
+	the xemacs process did not exit, but looped infinitely here.  This
+	fixes that problem.
+
 2002-10-04  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* regex.c (re_match_2_internal): Declare num_nonshy_regs in
--- a/src/event-Xt.c	Tue Oct 08 03:45:12 2002 +0000
+++ b/src/event-Xt.c	Tue Oct 08 04:50:08 2002 +0000
@@ -3146,8 +3146,29 @@
 static void
 drain_X_queue (void)
 {
+  Lisp_Object devcons, concons;
+  CONSOLE_LOOP (concons)
+  {
+    struct console *con = XCONSOLE (XCAR (concons));
+    if (!con->input_enabled)
+      continue;
+
+    CONSOLE_DEVICE_LOOP (devcons, con)
+    {
+      struct device* d;
+      Display* display;
+      d = XDEVICE (XCAR (devcons));
+      if (DEVICE_X_P (d) && DEVICE_X_DISPLAY (d)) {
+        display = DEVICE_X_DISPLAY (d);
+        while (XEventsQueued (display, QueuedAfterReading))
+          XtAppProcessEvent (Xt_app_con, XtIMXEvent);
+      }
+    }
+  }
+  /*
   while (XtAppPending (Xt_app_con) & XtIMXEvent)
     XtAppProcessEvent (Xt_app_con, XtIMXEvent);
+  */
 }
 
 static int