GNU bug report logs - #25521
26.0.50; After (make-frame '((name . "foo"))) (select-frame-by-name "foo") doesn't see the frame

Previous Next

Package: emacs;

Reported by: Alex 'QWxleA' Poslavsky <qwxlea <at> gmail.com>

Date: Tue, 24 Jan 2017 21:11:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.0.50

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 25521 <at> debbugs.gnu.org, qwxlea <at> gmail.com
Subject: bug#25521: 26.0.50; After (make-frame '((name . "foo"))) (select-frame-by-name "foo") doesn't see the frame
Date: Fri, 29 Sep 2017 08:48:04 -0400
[Message part 1 (text/plain, inline)]
>> Hmm, that is actually less effect than I expected.  I recall now that
>> some non-relevant MapNotify events get sent in this case [1].  These
>> make x_wait_for_event (f, MapNotify) return earlier than the previous
>> busy wait.

I should check my assumptions more carefully, the problem was actually
that I didn't set the timeout correctly; the whole seconds part was
being dropped.  Fixed with the following (full patches are attached as
well).

-  tmo = make_timespec (0, (long int) (timeout * 1000 * 1000 * 1000));
+  time_t timeout_seconds = (time_t) timeout;
+  tmo = make_timespec
+    (timeout_seconds, (long int) ((timeout - timeout_seconds)
+                                  * 1000 * 1000 * 1000));

And here are the resulting timings (the last is less than 100 because I
got bored of waiting).

    (let ((x-wait-for-event-timeout nil))
      (benchmark 1 '(make-frame-command)))"Elapsed time: 0.117144s (0.042904s in 1 GCs)"
    (let ((x-wait-for-event-timeout 0.1)) ; default
      (benchmark 1 '(make-frame-command)))"Elapsed time: 0.210824s (0.043483s in 1 GCs)"
    (let ((x-wait-for-event-timeout 100.0))
      (benchmark 1 '(make-frame-command)))"Elapsed time: 38.288529s (0.043459s in 1 GCs)"

martin rudalics <rudalics <at> gmx.at> writes:

> Shouldn't it work to wait only for VisibilityNotify events for the given
> frame?

Thanks for the nudge.  Waiting for VisibilityNotify works too (after
fixing the timeout bug), by the way, but it's MapNotify which has the
Lisp visibile effect.

[v4-0001-Let-select-frame-by-name-choose-any-frame-when-ca.patch (text/plain, attachment)]
[v4-0002-Bring-back-the-busy-wait-after-x_make_frame_visib.patch (text/plain, attachment)]
[v4-0003-Wait-for-frame-visibility-with-timeout-in-w32term.patch (text/plain, attachment)]

This bug report was last modified 7 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.