From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: select-frame-set-input-focus fails to raise the frame Date: Thu, 14 Dec 2017 16:03:31 -0500 Message-ID: References: <20171213204737.GA1621@breton.holly.idiocy.org> <20171213222634.GA2144@breton.holly.idiocy.org> Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114970ec2f35a70560533997" X-Trace: blaine.gmane.org 1513285449 7538 195.159.176.226 (14 Dec 2017 21:04:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 14 Dec 2017 21:04:09 +0000 (UTC) Cc: emacs-devel To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 14 22:04:06 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePafl-0001lb-Jn for ged-emacs-devel@m.gmane.org; Thu, 14 Dec 2017 22:04:05 +0100 Original-Received: from localhost ([::1]:43048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePafs-000187-Lr for ged-emacs-devel@m.gmane.org; Thu, 14 Dec 2017 16:04:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePafm-00017z-6M for emacs-devel@gnu.org; Thu, 14 Dec 2017 16:04:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePafi-00040n-GJ for emacs-devel@gnu.org; Thu, 14 Dec 2017 16:04:06 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePafi-00040T-9u for emacs-devel@gnu.org; Thu, 14 Dec 2017 16:04:02 -0500 Original-Received: from mail-qk0-f182.google.com ([209.85.220.182]:34566) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ePafi-0001GG-1n for emacs-devel@gnu.org; Thu, 14 Dec 2017 16:04:02 -0500 Original-Received: by mail-qk0-f182.google.com with SMTP id d66so7975093qkg.1 for ; Thu, 14 Dec 2017 13:04:01 -0800 (PST) X-Gm-Message-State: AKGB3mJrnfIeLJi82e5jgr+cjZVwSpih8tV821OsMUumm1TOsfsnK1mZ sP5k+RTm9OCZn74/xERKo/U15AttXwnSLusiJ5s= X-Google-Smtp-Source: ACJfBouFejMrm+JOFP3i+bnc9GU6lzp+F+UgC8P5D3iM/2OHfmgAWmABBPKajO3AF0PEXgHU3IZR3n7VBt1vQ0m8ZJQ= X-Received: by 10.55.42.75 with SMTP id q72mr18019739qkh.57.1513285441499; Thu, 14 Dec 2017 13:04:01 -0800 (PST) Original-Received: by 10.200.55.124 with HTTP; Thu, 14 Dec 2017 13:03:31 -0800 (PST) In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221065 Archived-At: --001a114970ec2f35a70560533997 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 13, 2017 at 7:33 PM, Robert Weiner wrote: > The combination of (sit-for 0) to cause > redisplay followed by a (sleep-for ) solved the problem > completely=E2=80=8B for me. > =E2=80=8BWell, 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 =E2=80=8Bwhen 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=E2=80=8B --001a114970ec2f35a70560533997 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 13, 2= 017 at 7:33 PM, Robert Weiner <rsw= @gnu.org> wrote:=
The combination of (sit-for 0) to cause
redisplay followed by a (sleep-for <n>) so= lved the problem
comple= tely=E2=80=8B for me.

=E2=80= =8BWell, one more problem remains here.=C2=A0 If the new frame is created w= ith
its window showing buffer1 and then set-window-buffer is used to
=
chan= ge it to buffer2 (or even if switch-to-buffer is used), buffer2 is
not dis= played =E2=80=8Bwhen the new frame is temporarily displayed (buffer1 is).
= Not until after Emacs becomes idle agai is buffer2 displayed in this new
f= rame.

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
buf= fer2 in the new frame.

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

(defun test2 ()
=C2=A0 (let ((depress-frame (select= ed-frame))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (release-frame (make-frame)))
= =C2=A0 =C2=A0 (set-window-buffer (frame-selected-window release-frame) &quo= t;*scratch*")
=C2=A0 =C2=A0 (sit-for 0)
=C2=A0 =C2=A0 (sleep-for 2= )
=C2=A0 =C2=A0 (select-frame-set-input-focus depress-frame)
=
=C2=A0 =C2= =A0 (sit-for 0)
=C2=A0 =C2=A0 (sleep-for 2)
=C2=A0 =C2=A0 (select-frame= -set-input-focus release-frame)))
=
(test2)

=
Bob= =E2=80=8B

--001a114970ec2f35a70560533997--