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 23:39:23 +0300 [thread overview]
Message-ID: <877g5qoh7c.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvk39s3qs7.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Sun, 11 May 2014 18:29:19 -0400")
>>>> + ;; but `raise-frame' forcibly switches to an Emacs frame
>>>> when the Window List is active,
>
> Well, this behavior is a choice of the window-manager. While I'm very
> happy to call raise-frame less often (so I generally agree with the
> direction of the patch), you could argue that this might be a bug in the
> window-manager.
raise-frame causes more trouble, e.g. when another application is
in full-screen mode, then they both fight for which of them should stay
on the top, so typing a key in Emacs re-raises the selected Emacs frame,
and then another application brings itself to the front.
A comment in `mouse-avoidance-set-mouse-position' explains its rationale:
;; Ideally, should check if X,Y is in the current frame, and if not,
;; leave the mouse where it was. However, this is currently
;; difficult to do, so we just raise the frame to avoid frame switches.
But actually such check already exists in `mouse-avoidance-ignore-p':
(not (eq (car (mouse-position)) (selected-frame)))
and the mouse pointer is not moved when it's outside of the selected frame.
So I really see no problems with this patch:
=== modified file 'lisp/avoid.el'
--- lisp/avoid.el 2014-01-01 07:43:34 +0000
+++ lisp/avoid.el 2014-05-12 20:31:28 +0000
@@ -52,9 +52,6 @@
;;
;; - Using this code does slow Emacs down. "banish" mode shouldn't
;; be too bad, and on my workstation even "animate" is reasonable.
-;;
-;; - It ought to find out where any overlapping frames are and avoid them,
-;; rather than always raising the frame.
;; Credits:
;; This code was helped by all those who contributed suggestions,
@@ -172,12 +170,8 @@ (defun mouse-avoidance-point-position ()
(defun mouse-avoidance-set-mouse-position (pos)
;; Carefully set mouse position to given position (X . Y)
- ;; Ideally, should check if X,Y is in the current frame, and if not,
- ;; leave the mouse where it was. However, this is currently
- ;; difficult to do, so we just raise the frame to avoid frame switches.
;; Returns t if it moved the mouse.
(let ((f (selected-frame)))
- (raise-frame f)
(set-mouse-position f (car pos) (cdr pos))
t))
@@ -342,7 +336,7 @@ (defun mouse-avoidance-ignore-p ()
(let ((modifiers (event-modifiers (car last-input-event))))
(or (memq (car last-input-event)
'(mouse-movement scroll-bar-movement
- select-window switch-frame))
+ select-window focus-out))
(memq 'click modifiers)
(memq 'double modifiers)
(memq 'triple modifiers)
@@ -403,8 +403,6 @@ (defun mouse-avoidance-mode (&optional m
* cat-and-mouse: Same as `animate'.
* proteus: As `animate', but changes the shape of the mouse pointer too.
-Whenever the mouse is moved, the frame is also raised.
-
\(See `mouse-avoidance-threshold' for definition of \"too close\",
and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
definition of \"random distance\".)"
next prev parent reply other threads:[~2014-05-12 20:39 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
2014-05-11 22:29 ` Stefan Monnier
2014-05-12 20:39 ` Juri Linkov [this message]
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=877g5qoh7c.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.