unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Aiken <acairncross@gmail.com>,
	"Clément Pit--Claudel" <clement.pit@gmail.com>,
	24091@debbugs.gnu.org
Subject: bug#24091: 24.5; High CPU usage at startup while hidden
Date: Sat, 3 Sep 2016 16:03:33 -0400	[thread overview]
Message-ID: <CAM-tV-_2L7NpKoZtkWrBVO_HBQo5h9C7ZGW_QJF5zyRPyi4Vrg@mail.gmail.com> (raw)
In-Reply-To: <83wpisddgb.fsf@gnu.org>

On Sat, Sep 3, 2016 at 2:51 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Noam Postavsky <npostavs@users.sourceforge.net>
>> Date: Sat, 3 Sep 2016 14:40:23 -0400
>> Cc: 24091@debbugs.gnu.org, Aiken <acairncross@gmail.com>,
>>       Clément Pit--Claudel <clement.pit@gmail.com>
>>
>> >> >         if ((FRAME_ICONIFIED_P (f) || FRAME_VISIBLE_P (f)) &&  ++tries > 100)
>> >> >           break;
>> >>
>> >> No, which sort of makes sense since the frame isn't actually visible.
>> >
>> > But you said the MapNotify event was received?  Doesn't that cause the
>> > frame to become marked as visible?
>>
>> Only if x_top_window_to_frame returns non-nil, which it does not.
>
> Why doesn't it, in this case, and how are things different with a
> "normal" startup, which doesn't infloop?

Hmm, it's hard to tell. In the case where Emacs is opening in the
current workspace, event->xmap.window corresponds XtWindow
(f->output_data.x->widget) and in the problematic case of opening
Emacs in another workspace, it doesn't. The contents of event are
created in the guts of Xlib I guess, which makes it somewhat
mysterious.

>
> Btw, I'm only asking these questions on the assumption that we have no
> working idea for how to solve this.  If that assumption is false, feel
> free to ignore me.

No firm ideas, but as I've been stepping around this code, I'm more
and more wondering why we have this loop at all. The comment above
x_make_frame_visible says

/* This tries to wait until the frame is really visible.
   However, if the window manager asks the user where to position
   the frame, this will return before the user finishes doing that.
   The frame will not actually be visible at that time,
   but it will become visible later when the window manager
   finishes with it.  */

So I guess the loop is the part that "tries to wait". But if that
doesn't even work some of the time, why is it really necessary at all?
The code running after this function returns can't rely on this
working, so it would have to handle the not-yet-visible case anyway...





  reply	other threads:[~2016-09-03 20:03 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAM-tV-_2L7NpKoZtkWrBVO_HBQo5h9C7ZGW_QJF5zyRPyi4Vrg@mail.gmail.com \
    --to=npostavs@users.sourceforge.net \
    --cc=24091@debbugs.gnu.org \
    --cc=acairncross@gmail.com \
    --cc=clement.pit@gmail.com \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).