GNU bug report logs -
#998
after split-window-horizontally scroll works only on first window
Previous Next
Reported by: Davide Viti <zinosat <at> tiscali.it>
Date: Thu, 18 Sep 2008 13:55:03 UTC
Severity: normal
Tags: patch, wontfix
Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
> it does fix the problem!
OK. So I could install the attached patch. Any objections?
martin
[998.diff (text/plain, inline)]
*** scroll-bar.el.~1.59.~ 2008-05-06 09:57:49.000000000 +0200
--- scroll-bar.el 2008-09-30 08:56:36.312500000 +0200
***************
*** 295,300 ****
--- 295,311 ----
;;; Tookit scroll bars.
+ (defcustom scroll-bar-resample-mouse-position nil
+ "Non-nil means re-sample mouse position when scrolling.
+ When your mouse-wheel scrolls the wrong window, setting this to
+ non-nil might help. The mouse cursor must be within the window
+ you want to scroll in order for this to take effect.
+
+ This option works for toolkit scrollbars only."
+ :type 'boolean
+ :group 'frames
+ :group 'mouse
+ :version "23.1")
(defun scroll-bar-toolkit-scroll (event)
(interactive "e")
***************
*** 302,341 ****
(window (nth 0 end-position))
(part (nth 4 end-position))
before-scroll)
! (cond ((eq part 'end-scroll))
! (t
! (with-current-buffer (window-buffer window)
! (setq before-scroll point-before-scroll))
! (save-selected-window
! (select-window window)
! (setq before-scroll (or before-scroll (point)))
! (cond ((eq part 'above-handle)
! (scroll-up '-))
! ((eq part 'below-handle)
! (scroll-up nil))
! ((eq part 'ratio)
! (let* ((portion-whole (nth 2 end-position))
! (lines (scroll-bar-scale portion-whole
! (1- (window-height)))))
! (scroll-up (cond ((not (zerop lines)) lines)
! ((< (car portion-whole) 0) -1)
! (t 1)))))
! ((eq part 'up)
! (scroll-up -1))
! ((eq part 'down)
! (scroll-up 1))
! ((eq part 'top)
! (set-window-start window (point-min)))
! ((eq part 'bottom)
! (goto-char (point-max))
! (recenter))
! ((eq part 'handle)
! (scroll-bar-drag-1 event))))
! (sit-for 0)
! (with-current-buffer (window-buffer window)
! (setq point-before-scroll before-scroll))))))
!
!
;;;; Bindings.
--- 313,361 ----
(window (nth 0 end-position))
(part (nth 4 end-position))
before-scroll)
! (when scroll-bar-resample-mouse-position
! ;; With some mouse drivers the window reported in EVENT might not
! ;; be valid, see Bug#998. Here we re-sample the mouse position in
! ;; the hope to get a more suitable window.
! (condition-case nil
! (let* ((mouse-position (mouse-position))
! (mouse-window
! (window-at (cadr mouse-position)
! (cddr mouse-position)
! (car mouse-position))))
! (when (window-live-p mouse-window)
! (setq window mouse-window)))
! (error nil)))
!
! (unless (eq part 'end-scroll)
! (with-selected-window window
! (setq before-scroll (or point-before-scroll (point)))
! (cond
! ((eq part 'above-handle)
! (scroll-up '-))
! ((eq part 'below-handle)
! (scroll-up nil))
! ((eq part 'ratio)
! (let* ((portion-whole (nth 2 end-position))
! (lines (scroll-bar-scale portion-whole
! (1- (window-height)))))
! (scroll-up (cond ((not (zerop lines)) lines)
! ((< (car portion-whole) 0) -1)
! (t 1)))))
! ((eq part 'up)
! (scroll-up -1))
! ((eq part 'down)
! (scroll-up 1))
! ((eq part 'top)
! (set-window-start window (point-min)))
! ((eq part 'bottom)
! (goto-char (point-max))
! (recenter))
! ((eq part 'handle)
! (scroll-bar-drag-1 event))))
! (sit-for 0)
! (with-current-buffer (window-buffer window)
! (setq point-before-scroll before-scroll)))))
;;;; Bindings.
This bug report was last modified 13 years and 297 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.