emacs-devel
[Top][All Lists]
Advanced

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

Re: Tools bar an menu bar in rev. 115447? [Cygwin]


From: Ken Brown
Subject: Re: Tools bar an menu bar in rev. 115447? [Cygwin]
Date: Wed, 11 Dec 2013 16:59:31 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 12/11/2013 4:37 PM, Angelo Graziosi wrote:
Hi Dmitry,

Il 11/12/2013 18.53, Ken Brown ha scritto:
On 12/10/2013 6:12 PM, Angelo Graziosi wrote:
The issue seems Cygwin specific because I cannot reproduce it with
similar GTK builds on GNU/Linux Ubuntu 12.04...

A bisection shows that the problem starts with the following commit:

revno: 115394
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.

any comment?

The patch below seems to fix the problem. It essentially just restores some code that Dmitry removed. (It also reverts a later change that Paul made in rev 115412 as a result of the removal.) Dmitry, did you have some reason for removing that code? I can't see that it has anything to do with the bug you were trying to fix.

Ken

=== modified file 'src/keyboard.c'
--- src/keyboard.c      2013-12-07 23:04:10 +0000
+++ src/keyboard.c      2013-12-11 21:45:31 +0000
@@ -1954,7 +1954,6 @@

 static struct atimer *poll_timer;

-#ifdef HAVE_NTGUI
 /* Poll for input, so that we catch a C-g if it comes in.  */
 void
 poll_for_input_1 (void)
@@ -1963,7 +1962,6 @@
       && !waiting_for_input)
     gobble_input ();
 }
-#endif

 /* Timer callback function for poll_timer.  TIMER is equal to
    poll_timer.  */
@@ -2015,8 +2013,6 @@
 #endif
 }

-#ifdef HAVE_NTGUI
-
 /* True if we are using polling to handle input asynchronously.  */

 bool
@@ -2031,7 +2027,6 @@
   return 0;
 #endif
 }
-#endif

 /* Turn off polling.  */


=== modified file 'src/xterm.c'
--- src/xterm.c 2013-12-11 15:06:04 +0000
+++ src/xterm.c 2013-12-11 21:36:55 +0000
@@ -8923,6 +8923,23 @@
       {
        /* 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 ())
+         {
+           /* 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;
+         }
        if (XPending (FRAME_X_DISPLAY (f)))
          {
            XEvent xev;






reply via email to

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