[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master dd71222208: Make precision scrolling on top of the tool bar work
From: |
Po Lu |
Subject: |
master dd71222208: Make precision scrolling on top of the tool bar work |
Date: |
Tue, 1 Mar 2022 02:39:15 -0500 (EST) |
branch: master
commit dd71222208324a1c6dad3ad42e3c73645ceb94f5
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Make precision scrolling on top of the tool bar work
* lisp/pixel-scroll.el (pixel-scroll-precision-mode-map): Bind
some more events.
(pixel-scroll-precision):
(pixel-scroll-start-momentum): If window is a frame, use its
selected window.
---
lisp/pixel-scroll.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 042c8a419e..bfe48ef1f9 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -129,6 +129,9 @@ is always with pixel resolution.")
(define-key map [vertical-scroll-bar wheel-down] 'pixel-scroll-precision)
(define-key map [vertical-scroll-bar wheel-up] 'pixel-scroll-precision)
(define-key map [vertical-scroll-bar touch-end]
'pixel-scroll-start-momentum)
+ (define-key map [tool-bar wheel-down] 'pixel-scroll-precision)
+ (define-key map [tool-bar wheel-up] 'pixel-scroll-precision)
+ (define-key map [tool-bar touch-end] 'pixel-scroll-start-momentum)
(define-key map [left-margin wheel-down] 'pixel-scroll-precision)
(define-key map [left-margin wheel-up] 'pixel-scroll-precision)
(define-key map [left-margin touch-end] 'pixel-scroll-start-momentum)
@@ -669,6 +672,8 @@ wheel."
(interactive "e")
(let ((window (mwheel-event-window event))
(current-window (selected-window)))
+ (when (framep window)
+ (setq window (frame-selected-window window)))
(if (and (nth 4 event))
(let ((delta (round (cdr (nth 4 event)))))
(unless (zerop delta)
@@ -742,6 +747,8 @@ It is a vector of the form [ VELOCITY TIME SIGN ]."
(when pixel-scroll-precision-use-momentum
(let ((window (mwheel-event-window event))
(state nil))
+ (when (framep window)
+ (setq window (frame-selected-window window)))
(setq state (pixel-scroll-kinetic-state window))
(when (and (aref state 1)
(listp (aref state 0)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master dd71222208: Make precision scrolling on top of the tool bar work,
Po Lu <=