[Top][All Lists]

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

bug#25521: 26.0.50; After (make-frame '((name . "foo"))) (select-frame-b

From: Noam Postavsky
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)

>> 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

-  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 <address@hidden> 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.

Attachment: v4-0001-Let-select-frame-by-name-choose-any-frame-when-ca.patch
Description: patch

Attachment: v4-0002-Bring-back-the-busy-wait-after-x_make_frame_visib.patch
Description: patch

Attachment: v4-0003-Wait-for-frame-visibility-with-timeout-in-w32term.patch
Description: patch

reply via email to

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