From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 17439@debbugs.gnu.org
Subject: bug#17439: 24.3.50; run-with-idle-timer runs on focus-out
Date: Mon, 12 May 2014 00:31:48 +0300 [thread overview]
Message-ID: <87r440gfhf.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwv1tw058sb.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Sun, 11 May 2014 17:06:32 -0400")
>> + (unless (and (consp last-input-event)
>> + (symbolp (car last-input-event))
>> + (memq (car last-input-event)
>
> Aka (unless (memq (car-safe last-input-event)
This is what I thought about, but decided to keep
code consistency with `mouse-avoidance-ignore-p'.
But `mouse-avoidance-ignore-p' could be optimized too.
>> + '(
>> + ;; `run-with-idle-timer' generates the `focus-out'
>
> Huh? `run-with-idle-timer' is not supposed to generate any event.
It runs on `focus-out', as this short test demonstrates:
(defun test () (message "%S" last-input-event))
(setq timer (run-with-idle-timer 0.1 t 'test))
It generates:
(focus-in #<frame emacs@localhost 0x1121908>)
(focus-out #<frame emacs@localhost 0x1121908>)
>> + ;; event on switching out from the current frame,
>> + ;; but `raise-frame' brings the same frame back,
>> + ;; so ignore `focus-out' here.
>> + focus-out
>
> Running mouse avoidance after focus-out does not seem very useful, so we
> should filter out focus-out elsewhere than here.
I'll move `focus-out' back to `mouse-avoidance-ignore-p'
to not move the mouse pointer on `focus-out'.
>> + ;; Some window managers generate the `focus-in' event
>> + ;; when showing the Window List,
>
> What means "showing the Window List"?
It depends on the desktop environment, but usually this is a list of windows
shown after typing Alt-Tab.
>> + ;; but `raise-frame' forcibly switches to an Emacs frame when the Window List is active,
>
> I don't know what this is talking about either.
This is specific behavior observed at least in one window manager (Gnome 2),
where typing Alt-Tab shows the Window List and generates the `focus-in' event
in Emacs at the same time.
>> + ;; so `focus-in' needs to be ignored here too.
>
> Shouldn't `switch-frame' be ignored for similar reasons, then?
Currently `switch-frame' is ignored in `mouse-avoidance-ignore-p',
so the mouse pointer is not moved when `switch-frame' is generated
in a new frame after switching between Emacs frames.
But maybe it should be handled like `focus-in', i.e. also
to not ignore it in `mouse-avoidance-ignore-p' and to move
the mouse pointer after switching between Emacs frames.
next prev parent reply other threads:[~2014-05-11 21:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 20:45 bug#17439: 24.3.50; run-with-idle-timer runs on focus-out Juri Linkov
2014-05-09 6:28 ` Eli Zaretskii
2014-05-09 20:35 ` Juri Linkov
2014-05-10 6:16 ` Eli Zaretskii
2014-05-10 20:38 ` Juri Linkov
2014-05-11 20:19 ` Juri Linkov
2014-05-11 21:06 ` Stefan Monnier
2014-05-11 21:31 ` Juri Linkov [this message]
2014-05-11 22:29 ` Stefan Monnier
2014-05-12 20:39 ` Juri Linkov
2014-05-13 19:33 ` Stefan Monnier
2014-05-20 21:14 ` Juri Linkov
2014-05-20 22:12 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r440gfhf.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=17439@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.