unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* select-frame-set-input-focus mystery
@ 2006-05-17 22:45 David Reitter
       [not found] ` <wlwtckunhs.wl%mituharu@math.s.chiba-u.ac.jp>
  0 siblings, 1 reply; 2+ messages in thread
From: David Reitter @ 2006-05-17 22:45 UTC (permalink / raw)


While producing a fix for the pop-to-buffer problem, I encountered  
this strange behavior. Can somebody please explain what's happening,  
or check if this is a bug?

The following code should select frame f1 and set input focus to it.  
(Open a second frame and keep it partially over the first one to  
reproduce.)

(let ((f1 (car (frame-list)))
       (f2 (car (cdr (frame-list)))))

   (print f2)
   (select-frame-set-input-focus f2)
   (print f1)
   (select-frame-set-input-focus f1))


However, in my Emacs build (current CVS Emacs, Carbon port) it will  
leave f1 raised, but set input focus to f2.

Additionally, if you want to select f2 with a mouse click (into the  
single window shown), it will NOT be selected!

However, the following will work just fine:

(let ((f1 (car (frame-list)))
       (f2 (car (cdr (frame-list)))))

   (print f2)
   (select-frame-set-input-focus f2)
   (print f1)
   (message "test")
   (select-frame-set-input-focus f1))

Note that all I've done was to insert a `message' command.

The documentation of `select-frame' says that the window manager may  
select another frame upon returning to the main event loop.
However, one would expect that `select-frame-set-input-focus' sets  
the input focus in a way that actually works in all circumstances,  
right?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: select-frame-set-input-focus mystery
       [not found] ` <wlwtckunhs.wl%mituharu@math.s.chiba-u.ac.jp>
@ 2006-05-18  9:57   ` David Reitter
  0 siblings, 0 replies; 2+ messages in thread
From: David Reitter @ 2006-05-18  9:57 UTC (permalink / raw)
  Cc: Emacs-Devel '


[-- Attachment #1.1: Type: text/plain, Size: 642 bytes --]

On 18 May 2006, at 02:31, YAMAMOTO Mitsuharu wrote:

>>>>>> On Wed, 17 May 2006 23:45:11 +0100, David Reitter  
>>>>>> <david.reitter@gmail.com> said:
>
>> While producing a fix for the pop-to-buffer problem, I encountered
>> this strange behavior. Can somebody please explain what's happening,
>> or check if this is a bug?
>
> It seems to be a bug in the Carbon port.  Please try removing
> `if (dpyinfo->x_focus_frame != f)' from Fx_focus_frame in macfns.c.
> `dpyinfo->x_focus_frame' is not synchronized until window events are
> processed.  That would explain why `message' makes a difference.

Yes, that's definitely a fix. Thank you!


[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2454 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-18  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-17 22:45 select-frame-set-input-focus mystery David Reitter
     [not found] ` <wlwtckunhs.wl%mituharu@math.s.chiba-u.ac.jp>
2006-05-18  9:57   ` David Reitter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).