bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#998: after split-window-horizontally scroll works only on first wind


From: martin rudalics
Subject: bug#998: after split-window-horizontally scroll works only on first window
Date: Wed, 24 Sep 2008 11:35:21 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

I've been able to reproduce the bug by clicking the small dart above the
scrollbar of a right window and subsequently scrolling the mouse-wheel.
In that case the `event' argument passed to `scroll-bar-toolkit-scroll'
invariantly names the left (sometimes the minibuffer) window.  When I
sample the mouse explicitly the bug doesn't occur.  Davide, could you
try to append the code below to your .emacs and see whether it makes the
bug go away?

Thanks, martin.


(defun scroll-bar-toolkit-scroll (event)
  (interactive "e")
  (let* ((end-position (event-end event))
         (mouse-position (mouse-position))
         (window
          (condition-case nil
              (window-at (cadr mouse-position) (cddr mouse-position)
                         (car mouse-position))
            (error (nth 0 end-position))))
         (part (nth 4 end-position))
         before-scroll)
    (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)))))







reply via email to

[Prev in Thread] Current Thread [Next in Thread]