emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115394: * xterm.c (input_signal_count): Remove.


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r115394: * xterm.c (input_signal_count): Remove.
Date: Fri, 06 Dec 2013 05:49:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115394
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-12-06 09:49:05 +0400
message:
  * xterm.c (input_signal_count): Remove.
  (x_dispatch_event): Define unconditionally.
  (x_make_frame_visible): Process X events until the frame
  is really visible (Bug#16027).
  * xterm.h (x_dispatch_event): Declare unconditionally.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
  src/xterm.h                    xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-12-05 16:20:11 +0000
+++ b/src/ChangeLog     2013-12-06 05:49:05 +0000
@@ -1,3 +1,11 @@
+2013-12-06  Dmitry Antipov  <address@hidden>
+
+       * xterm.c (input_signal_count): Remove.
+       (x_dispatch_event): Define unconditionally.
+       (x_make_frame_visible): Process X events until the frame
+       is really visible (Bug#16027).
+       * xterm.h (x_dispatch_event): Declare unconditionally.
+
 2013-12-05  Jan Djärv  <address@hidden>
 
        * nsfns.m (ns_frame_parm_handlers): Add right/bottom_divider_width.

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2013-12-05 13:46:30 +0000
+++ b/src/xterm.c       2013-12-06 05:49:05 +0000
@@ -165,11 +165,6 @@
 
 static Time ignore_next_mouse_click_timeout;
 
-/* Incremented by XTread_socket whenever it really tries to read
-   events.  */
-
-static int volatile input_signal_count;
-
 /* Used locally within XTread_socket.  */
 
 static int x_noop_count;
@@ -253,9 +248,6 @@
 static int handle_one_xevent (struct x_display_info *,
                              const XEvent *, int *,
                              struct input_event *);
-#ifdef USE_GTK
-static int x_dispatch_event (XEvent *, Display *);
-#endif
 /* Don't declare this _Noreturn because we want no
    interference with debugging failing X calls.  */
 static void x_connection_closed (Display *, const char *);
@@ -6853,8 +6845,6 @@
   return count;
 }
 
-#if defined USE_GTK || defined USE_X_TOOLKIT
-
 /* Handles the XEvent EVENT on display DISPLAY.
    This is used for event loops outside the normal event handling,
    i.e. looping while a popup menu or a dialog is posted.
@@ -6873,8 +6863,6 @@
 
   return finish;
 }
-#endif
-
 
 /* Read events coming from the X server.
    Return as soon as there are no more events to be read.
@@ -6893,9 +6881,6 @@
 
   block_input ();
 
-  /* So people can tell when we have read the available input.  */
-  input_signal_count++;
-
   /* For debugging, this gives a way to fake an I/O error.  */
   if (dpyinfo == XTread_socket_fake_io_error)
     {
@@ -8826,9 +8811,6 @@
 x_make_frame_visible (struct frame *f)
 {
   int original_top, original_left;
-  int retry_count = 2;
-
- retry:
 
   block_input ();
 
@@ -8877,7 +8859,6 @@
      so that incoming events are handled.  */
   {
     Lisp_Object frame;
-    int count;
     /* This must be before UNBLOCK_INPUT
        since events that arrive in response to the actions above
        will set it when they are handled.  */
@@ -8931,46 +8912,18 @@
 
     XSETFRAME (frame, f);
 
-    /* Wait until the frame is visible.  Process X events until a
-       MapNotify event has been seen, or until we think we won't get a
-       MapNotify at all..  */
-    for (count = input_signal_count + 10;
-        input_signal_count < count && !FRAME_VISIBLE_P (f);)
+    /* Process X events until a MapNotify event has been seen.  */
+    while (!FRAME_VISIBLE_P (f))
       {
        /* Force processing of queued events.  */
        x_sync (f);
-
-       /* Machines that do polling rather than SIGIO have been
-          observed to go into a busy-wait here.  So we'll fake an
-          alarm signal to let the handler know that there's something
-          to be read.  We used to raise a real alarm, but it seems
-          that the handler isn't always enabled here.  This is
-          probably a bug.  */
-       if (input_polling_used ())
+       if (XPending (FRAME_X_DISPLAY (f)))
          {
-           /* It could be confusing if a real alarm arrives while
-              processing the fake one.  Turn it off and let the
-              handler reset it.  */
-           int old_poll_suppress_count = poll_suppress_count;
-           poll_suppress_count = 1;
-           poll_for_input_1 ();
-           poll_suppress_count = old_poll_suppress_count;
+           XEvent xev;
+           XNextEvent (FRAME_X_DISPLAY (f), &xev);
+           x_dispatch_event (&xev, FRAME_X_DISPLAY (f));
          }
       }
-
-    /* 2000-09-28: In
-
-       (let ((f (selected-frame)))
-          (iconify-frame f)
-         (raise-frame f))
-
-       the frame is not raised with various window managers on
-       FreeBSD, GNU/Linux and Solaris.  It turns out that, for some
-       unknown reason, the call to XtMapWidget is completely ignored.
-       Mapping the widget a second time works.  */
-
-    if (!FRAME_VISIBLE_P (f) && --retry_count != 0)
-      goto retry;
   }
 }
 

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2013-12-02 13:35:53 +0000
+++ b/src/xterm.h       2013-12-06 05:49:05 +0000
@@ -945,9 +945,7 @@
 extern void x_mouse_leave (struct x_display_info *);
 #endif
 
-#ifdef USE_X_TOOLKIT
 extern int x_dispatch_event (XEvent *, Display *);
-#endif
 extern int x_x_to_emacs_modifiers (struct x_display_info *, int);
 extern int x_display_pixel_height (struct x_display_info *);
 extern int x_display_pixel_width (struct x_display_info *);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]