GNU bug report logs - #43672
28.0.50; select-frame-set-input-focus does not set focus first time called

Previous Next

Package: emacs;

Reported by: Arthur Miller <arthur.miller <at> live.com>

Date: Mon, 28 Sep 2020 13:50:01 UTC

Severity: normal

Found in version 28.0.50

Full log


Message #20 received at 43672 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Arthur Miller <arthur.miller <at> live.com>, 43672 <at> debbugs.gnu.org
Subject: Re: bug#43672: 28.0.50; select-frame-set-input-focus does not set
 focus first time called
Date: Mon, 28 Sep 2020 19:59:08 +0200
> When calling
>
>        (select-frame-set-input-focus some-frame)
>
> the frame is raised, but does not recieve the focus. I have to call
> twice to 'select-frame-set-input-focus' for the frame to get
> focused. Docs says "focused if possible", so I am not sure if it some
> bug or/and how much does it depend on my window manager used; but
> calling it twice consecutively works.
>
> I have attached an example code. To reproduce, emacs -Q, an eval
> attached code.

These two settings don't make much sense

          (child-frame (make-frame   '((visible . 0)
                                       (undecorated . 0)

For the moment let's stick to the simpler

(defvar child-frame nil)

(defun make-child-frame ()
  (interactive)
  (setq child-frame
	(make-frame `((parent-frame . ,(selected-frame))
		      (left . 10)
		      (top . 10)
		      (width . 20)
		      (height . 10))))
  (select-frame-set-input-focus child-frame))

(defun delete-child-frame ()
  (interactive)
  (delete-frame child-frame))

If you call 'make-child-frame', does the child frame get selected?

If not, we have to try some workaround, maybe a (sit-for 0) before the
'select-frame-set-input-focus' call.

martin




This bug report was last modified 3 years and 56 days ago.

Previous Next


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