Subject: bug#17439: 24.3.50; run-with-idle-timer runs on focus-out

From: Eli Zaretskii <[email-masked]>
Date: Sat, 10 May 2014 09:16:33 +0300

> From: Juri Linkov <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 09 May 2014 23:35:20 +0300
> 
> > Why did you add focus-in as well?
> 
> When I tried to switch out with
> 
> (defun test () (message "%S" last-input-event))
> (setq timer (run-with-idle-timer 0.1 t 'test))
> 
> it prints to *Messages* both lines:
> 
> (focus-in #<frame emacs@localhost 0x1121908>)
> (focus-out #<frame emacs@localhost 0x1121908>)
> 
> `focus-in' is fired by the desktop window switcher
> that shows the list of desktop windows to switch.
> After selecting another window from the Window List,
> `focus-out' is fired eventually too.
> 
> So when `focus-in' is not ignored in avoid.el then the
> mouse cursor will be moved after showing the Window List.
> But it seems this is not a problem because special mouse
> processing is disabled when the Window List is shown.
> 
> > Wouldn't you want the mouse moved when you are about to type?
> 
> Yes, it's better to move the mouse on focusing in
> than later on typing a key after switching.

So are you saying we should NOT ignore focus-in?  If you still think
focus-in should be ignored, then I think the above description
(perhaps together with the window manager where it was observed)
should be in the comments to the code.

Thanks.