emacs-devel
[Top][All Lists]
Advanced

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

Re: select-frame-set-input-focus fails to raise the frame


From: Robert Weiner
Subject: Re: select-frame-set-input-focus fails to raise the frame
Date: Thu, 14 Dec 2017 16:03:31 -0500

On Wed, Dec 13, 2017 at 7:33 PM, Robert Weiner <address@hidden> wrote:
The combination of (sit-for 0) to cause
redisplay followed by a (sleep-for <n>) solved the problem
completely​ for me.

​Well, one more problem remains here.  If the new frame is created with
its window showing buffer1 and then set-window-buffer is used to
change it to buffer2 (or even if switch-to-buffer is used), buffer2 is
not displayed ​when the new frame is temporarily displayed (buffer1 is).
Not until after Emacs becomes idle agai is buffer2 displayed in this new
frame.

I have tried using sit-for, sleep-for, force-mode-line-update and
force-window-update but none of these seem to make redisplay show
buffer2 in the new frame.

Buffer2 is not known at the time of the new frame creation, so I can't
create it with that as the default.

(defun test2 ()
  (let ((depress-frame (selected-frame))
        (release-frame (make-frame)))
    (set-window-buffer (frame-selected-window release-frame) "*scratch*")
    (sit-for 0)
    (sleep-for 2)
    (select-frame-set-input-focus depress-frame)
    (sit-for 0)
    (sleep-for 2)
    (select-frame-set-input-focus release-frame)))

(test2)

Bob​


reply via email to

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