diff src/event-Xt.c @ 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 8401dcd2d43a
children 4f4c898836ab
line wrap: on
line diff
--- 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