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

From: martin rudalics <[email-masked]>
Date: Fri, 01 Sep 2017 15:02:45 +0200

> Hmm, I thought I could get away with using an existing hook.  But
 > looking at all the places where x_make_frame_visible is called, I'm
 > feeling reluctant to introduce lisp evaluation into them.  I think we
 > should go with Eli's idea, bring back the busy wait but add a timeout.

I'm not very convinced.  First, the present bug should not motivate this
change.  ‘select-frame-by-name’ is a pretty obscure function.  It fails
in the OP's case because the display info for the new frame has not been
yet set up.  In the interactive call, suggesting a default frame on the
current terminal makes sense; so consulting that info is useful.  But
the info is useless in a non-interactive call: Nothing should prevent
that function from selecting a frame with a given name on any display.

Second, we'll then have a third way how to wait on X for something to
happen: We already have x_wait_for_event with a fixed 0.1 second timeout
for frame resizing.  And we have x_sync_with_move which counts till 50,
may return early when the frame is within some fuzzy distance from the
expected position and waits another 0.5 seconds if the frame hasn't made
it there till then.

martin