all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 24091@debbugs.gnu.org
Subject: bug#24091: Problem caused by the fix for this bug
Date: Fri, 27 Oct 2017 10:11:19 -0400	[thread overview]
Message-ID: <e0e915bb-80fd-e7e3-a256-1cf003d94f0f@cornell.edu> (raw)
In-Reply-To: <CAM-tV-_Evmy3+uUt3Y=XD-8746OoxL0-huN2dAnpxwKDS3PU0g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1014 bytes --]

On 10/26/2017 4:40 PM, Noam Postavsky wrote:
> On Thu, Oct 26, 2017 at 2:12 PM, Ken Brown <kbrown@cornell.edu> wrote:
> 
>> The commit I cited was the first bad one (as determined by git bisect). The
>> problem still exists in the current HEAD of the emacs-26 branch.
> 
> Okay. I removed the code because my understanding of the comment was
> that it was needed to prevent a hang during the busy wait for
> visibility. Therefore, when I removed that busy wait, I thought that
> poll_for_input_1 was no longer needed either.
> 
> However, from what you say, it sounds like it's rather needed after
> creating a frame, unrelated to the waiting per se. I don't really
> understand what the code does, but I guess you could try putting the
> poll_for_input_1 stuff back in either before, inside, or after the
> x_wait_for_event at the end of x_make_frame_visible and see what
> helps?

Putting it before the x_wait_for_event fixes the problem.  Patch attached.

Eli, is it OK to push this to the release branch?

Ken

[-- Attachment #2: 0001-Fix-startup-display-on-Cygwin.patch --]
[-- Type: text/plain, Size: 1408 bytes --]

From 9160ce9d56222deb17a5c3922b66a0e8b214f751 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Fri, 27 Oct 2017 10:04:30 -0400
Subject: [PATCH] Fix startup display on Cygwin

* src/xterm.c (x_make_frame_visible): Restore code that forces
input to be read if input polling is used.  This is needed on
Cygwin.  (Bug#24091)
---
 src/xterm.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index d90654b101..92066e9229 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11504,6 +11504,23 @@ x_make_frame_visible (struct frame *f)
 
     /* Try to wait for a MapNotify event (that is what tells us when a
        frame becomes visible).  */
+
+    /* This hack is still in use at least for Cygwin.  See
+       http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html
+       and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24091#131.
+       Fake an alarm signal to let the handler know that there's
+       something to be read.  */
+    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;
+      }
+
     x_wait_for_event (f, MapNotify);
   }
 }
-- 
2.14.2


  reply	other threads:[~2017-10-27 14:11 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 23:11 bug#24091: 24.5; High CPU usage at startup while hidden aiken
2016-07-27 23:32 ` Noam Postavsky
2016-07-28  2:16 ` Clément Pit--Claudel
2016-07-28 17:43 ` aiken
2016-07-28 19:37   ` Clément Pit--Claudel
2016-07-28 20:21     ` aiken
2016-07-29  1:45   ` npostavs
2016-07-29  5:46     ` Eli Zaretskii
2016-07-30 13:54       ` Noam Postavsky
2016-07-30 15:41         ` Eli Zaretskii
2016-08-13 23:57           ` npostavs
2016-08-16  2:38             ` Eli Zaretskii
2016-09-03 17:29               ` Noam Postavsky
2016-09-03 17:45                 ` Eli Zaretskii
2016-09-03 17:53                   ` Noam Postavsky
2016-09-03 18:35                     ` Eli Zaretskii
2016-09-03 18:40                       ` Noam Postavsky
2016-09-03 18:51                         ` Eli Zaretskii
2016-09-03 20:03                           ` Noam Postavsky
2016-09-04  7:33                         ` martin rudalics
2016-09-04 12:35                           ` Noam Postavsky
2016-09-04 13:15                             ` martin rudalics
2016-09-04 13:40                               ` Noam Postavsky
2016-09-04 15:56                                 ` martin rudalics
2016-09-04 16:21                                   ` Noam Postavsky
2016-09-06 16:05                                     ` Eli Zaretskii
2017-01-13 10:19                                       ` Dominik Schrempf
2017-01-14  1:38                                         ` npostavs
2017-01-14  7:52                                           ` Eli Zaretskii
2017-01-16 23:36                                             ` Ken Raeburn
2017-01-17  3:40                                               ` Eli Zaretskii
2017-01-18  2:21                                                 ` npostavs
2017-01-20  5:16                                                   ` Ken Raeburn
2017-01-21  4:54                                                     ` npostavs
2017-01-23 17:14                                                       ` Dominik Schrempf
2017-10-26 17:22 ` bug#24091: Problem caused by the fix for this bug Ken Brown
2017-10-26 17:42   ` Noam Postavsky
2017-10-26 18:12     ` Ken Brown
2017-10-26 20:40       ` Noam Postavsky
2017-10-27 14:11         ` Ken Brown [this message]
2017-10-27 17:26           ` Eli Zaretskii
2017-10-27 17:53             ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0e915bb-80fd-e7e3-a256-1cf003d94f0f@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=24091@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.