diff options
| author | Juri Linkov | 2014-05-21 00:14:44 +0300 |
|---|---|---|
| committer | Juri Linkov | 2014-05-21 00:14:44 +0300 |
| commit | a2115113ef8fb235f7863055cedd37a4aaa28d76 (patch) | |
| tree | 6ffe2bffd8d282139e9974d3104e126a7704d2f7 /lisp | |
| parent | 0a5cfeeecb9e1038f9df3b34b61b797e56213a7b (diff) | |
| download | emacs-a2115113ef8fb235f7863055cedd37a4aaa28d76.tar.gz emacs-a2115113ef8fb235f7863055cedd37a4aaa28d76.zip | |
* lisp/avoid.el (mouse-avoidance-set-mouse-position): Don't raise frame.
(mouse-avoidance-ignore-p): Remove `switch-frame', add `focus-out'.
Add more modifiers: meta, control, shift, hyper, super, alt.
Fixes: debbugs:17439
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/avoid.el | 19 |
2 files changed, 15 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9374f20aacc..7d72258318c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-05-20 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * avoid.el (mouse-avoidance-set-mouse-position): Don't raise frame. | ||
| 4 | (mouse-avoidance-ignore-p): Remove `switch-frame', add `focus-out'. | ||
| 5 | Add more modifiers: meta, control, shift, hyper, super, alt. | ||
| 6 | (Bug#17439) | ||
| 7 | |||
| 1 | 2014-05-20 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2014-05-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * progmodes/scheme.el (scheme-mode-syntax-table): Remove hack for | 10 | * progmodes/scheme.el (scheme-mode-syntax-table): Remove hack for |
diff --git a/lisp/avoid.el b/lisp/avoid.el index f3013728931..de3958745a4 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el | |||
| @@ -52,9 +52,6 @@ | |||
| 52 | ;; | 52 | ;; |
| 53 | ;; - Using this code does slow Emacs down. "banish" mode shouldn't | 53 | ;; - Using this code does slow Emacs down. "banish" mode shouldn't |
| 54 | ;; be too bad, and on my workstation even "animate" is reasonable. | 54 | ;; be too bad, and on my workstation even "animate" is reasonable. |
| 55 | ;; | ||
| 56 | ;; - It ought to find out where any overlapping frames are and avoid them, | ||
| 57 | ;; rather than always raising the frame. | ||
| 58 | 55 | ||
| 59 | ;; Credits: | 56 | ;; Credits: |
| 60 | ;; This code was helped by all those who contributed suggestions, | 57 | ;; This code was helped by all those who contributed suggestions, |
| @@ -172,12 +169,8 @@ Analogous to `mouse-position'." | |||
| 172 | 169 | ||
| 173 | (defun mouse-avoidance-set-mouse-position (pos) | 170 | (defun mouse-avoidance-set-mouse-position (pos) |
| 174 | ;; Carefully set mouse position to given position (X . Y) | 171 | ;; Carefully set mouse position to given position (X . Y) |
| 175 | ;; Ideally, should check if X,Y is in the current frame, and if not, | ||
| 176 | ;; leave the mouse where it was. However, this is currently | ||
| 177 | ;; difficult to do, so we just raise the frame to avoid frame switches. | ||
| 178 | ;; Returns t if it moved the mouse. | 172 | ;; Returns t if it moved the mouse. |
| 179 | (let ((f (selected-frame))) | 173 | (let ((f (selected-frame))) |
| 180 | (raise-frame f) | ||
| 181 | (set-mouse-position f (car pos) (cdr pos)) | 174 | (set-mouse-position f (car pos) (cdr pos)) |
| 182 | t)) | 175 | t)) |
| 183 | 176 | ||
| @@ -342,12 +335,18 @@ redefine this function to suit your own tastes." | |||
| 342 | (let ((modifiers (event-modifiers (car last-input-event)))) | 335 | (let ((modifiers (event-modifiers (car last-input-event)))) |
| 343 | (or (memq (car last-input-event) | 336 | (or (memq (car last-input-event) |
| 344 | '(mouse-movement scroll-bar-movement | 337 | '(mouse-movement scroll-bar-movement |
| 345 | select-window switch-frame)) | 338 | select-window focus-out)) |
| 346 | (memq 'click modifiers) | 339 | (memq 'click modifiers) |
| 347 | (memq 'double modifiers) | 340 | (memq 'double modifiers) |
| 348 | (memq 'triple modifiers) | 341 | (memq 'triple modifiers) |
| 349 | (memq 'drag modifiers) | 342 | (memq 'drag modifiers) |
| 350 | (memq 'down modifiers))))))) | 343 | (memq 'down modifiers) |
| 344 | (memq 'meta modifiers) | ||
| 345 | (memq 'control modifiers) | ||
| 346 | (memq 'shift modifiers) | ||
| 347 | (memq 'hyper modifiers) | ||
| 348 | (memq 'super modifiers) | ||
| 349 | (memq 'alt modifiers))))))) | ||
| 351 | 350 | ||
| 352 | (defun mouse-avoidance-banish () | 351 | (defun mouse-avoidance-banish () |
| 353 | (if (not (mouse-avoidance-ignore-p)) | 352 | (if (not (mouse-avoidance-ignore-p)) |
| @@ -403,8 +402,6 @@ Effects of the different modes: | |||
| 403 | * cat-and-mouse: Same as `animate'. | 402 | * cat-and-mouse: Same as `animate'. |
| 404 | * proteus: As `animate', but changes the shape of the mouse pointer too. | 403 | * proteus: As `animate', but changes the shape of the mouse pointer too. |
| 405 | 404 | ||
| 406 | Whenever the mouse is moved, the frame is also raised. | ||
| 407 | |||
| 408 | \(See `mouse-avoidance-threshold' for definition of \"too close\", | 405 | \(See `mouse-avoidance-threshold' for definition of \"too close\", |
| 409 | and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for | 406 | and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for |
| 410 | definition of \"random distance\".)" | 407 | definition of \"random distance\".)" |