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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 998 in the body.
You can then email your comments to 998 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Davide Viti <zinosat <at> tiscali.it>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
As said in the subject, no matter which of the two windows is active,
when using the mouse wheel to scroll up / down, it always happens on the left
window.
Apologies if this is a known bug.
thanx in advance,
Davide
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
d:/emacs-22.2/etc/DEBUG for instructions.
In GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600)
of 2008-03-26 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: ITA
locale-coding-system: cp1252
default-enable-multibyte-characters: t
Major mode: C/l
Minor modes in effect:
display-time-mode: t
show-paren-mode: t
encoded-kbd-mode: t
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Davide Viti <zinosat <at> tiscali.it>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #10 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Thu, Sep 18, 2008 at 08:13:40PM +0200, martin rudalics wrote:
> > As said in the subject, no matter which of the two windows is active,
> > when using the mouse wheel to scroll up / down, it always happens on the
> left
> > window.
>
> Could you please type C-h k, scroll the mouse wheel, and so tell me what
> command it is bound to?
<vertical-scroll-bar> <mouse-1> (translated from <mouse-1>) at that spot runs the command scroll-bar-toolkit-scroll
which is an interactive compiled Lisp function in `scroll-bar.el'.
It is bound to <vertical-scroll-bar> <mouse-1>.
(scroll-bar-toolkit-scroll event)
Not documented.
thanx for your help,
Davide
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #15 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
> <vertical-scroll-bar> <mouse-1> (translated from <mouse-1>) at that spot runs the command scroll-bar-toolkit-scroll
> which is an interactive compiled Lisp function in `scroll-bar.el'.
OK. Could you now please append the following modified version of
`scroll-bar-toolkit-scroll' to your .emacs, restart Emacs, split the
window horizontally, move the mouse into each of these windows, scroll
the mouse and tell me whether the windows mentioned in the messages you
should see (here I get for example .... #<window 3 on .emacs>) have the
same or different values.
Thanks, martin.
;; code starts here
(defun scroll-bar-toolkit-scroll (event)
(interactive "e")
(let* ((end-position (event-end event))
(window (nth 0 end-position))
(part (nth 4 end-position))
before-scroll)
(message ".... %s" window)
(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))))))
;; code ends here
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Davide Viti <zinosat <at> tiscali.it>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #20 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Fri, Sep 19, 2008 at 09:01:21AM +0200, martin rudalics wrote:
> > <vertical-scroll-bar> <mouse-1> (translated from <mouse-1>) at that spot
> runs the command scroll-bar-toolkit-scroll
> > which is an interactive compiled Lisp function in `scroll-bar.el'.
>
> OK. Could you now please append the following modified version of
> `scroll-bar-toolkit-scroll' to your .emacs, restart Emacs, split the
> window horizontally, move the mouse into each of these windows, scroll
> the mouse and tell me whether the windows mentioned in the messages you
> should see (here I get for example .... #<window 3 on .emacs>) have the
> same or different values.
still not working and I get the very same message as yours (.... #<window 3 on .emacs>)
when scrolling the wheel on any of the two windows
regards,
Davide
PS: last night I gave it a go on my Ubuntu machine and it worked; C-h-k gave me this:
<mouse-5> (translated from <down-mouse-5> <mouse-5>) at that spot runs the command mwheel-scroll
which is an interactive compiled Lisp function in `mwheel.el'.
It is bound to <C-mouse-4>, <S-mouse-4>, <mouse-4>, <C-mouse-5>, <S-mouse-5>, <mouse-5>.
(mwheel-scroll event)
Scroll up or down according to the event.
This should only be bound to mouse buttons 4 and 5.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #25 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
> still not working and I get the very same message as yours (.... #<window 3 on .emacs>)
> when scrolling the wheel on any of the two windows
So the fault is not with `scroll-bar-toolkit-scroll' but with the wrong
window chosen when making the input-event. This could be related to
your mouse-driver - some of them try to "intelligently" guess the window
you want to scroll. Finding the reason of this might be non-trivial.
> PS: last night I gave it a go on my Ubuntu machine and it worked; C-h-k gave me this:
>
> <mouse-5> (translated from <down-mouse-5> <mouse-5>) at that spot runs the command mwheel-scroll
> which is an interactive compiled Lisp function in `mwheel.el'.
> It is bound to <C-mouse-4>, <S-mouse-4>, <mouse-4>, <C-mouse-5>, <S-mouse-5>, <mouse-5>.
> (mwheel-scroll event)
>
> Scroll up or down according to the event.
> This should only be bound to mouse buttons 4 and 5.
I'm afraid the assignment is currently beyond the control of Emacs
whenever you have scroll bars enabled. I suppose your Emacs on Windows
scrolls the right window (and runs `mwheel-scroll') when you disable
scroll bars, e.g., by putting (scroll-bar-mode -1) in your .emacs?
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Davide Viti <zinosat <at> tiscali.it>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #30 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Fri, Sep 19, 2008 at 10:42:35AM +0200, martin rudalics wrote:
> I'm afraid the assignment is currently beyond the control of Emacs
> whenever you have scroll bars enabled. I suppose your Emacs on Windows
> scrolls the right window (and runs `mwheel-scroll') when you disable
> scroll bars, e.g., by putting (scroll-bar-mode -1) in your .emacs?
that is correct: (scroll-bar-mode -1) fixes it
thanx,
Davide
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #35 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
> that is correct: (scroll-bar-mode -1) fixes it
But that's not a very good solution, I presume. What kind of mouse do
you have? Are you using Intelli-mouse settings, do you use something
like improved scroll-mode?
Wrt Emacs what is your value of `mouse-wheel-follow-mouse'? Does it
help to set this to t? What happens when you set
`mouse-autoselect-window' to t?
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #40 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
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)))))
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Davide Viti <zinosat <at> tiscali.it>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #45 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Wed, Sep 24, 2008 at 11:35:21AM +0200, martin rudalics wrote:
> 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?
it does fix the problem!
thanx alot,
Davide
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #50 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
[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.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #55 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> it does fix the problem!
> OK. So I could install the attached patch. Any objections?
Doesn't look too terrible, but I'd first want to understand why we're
only seeing this now. Shouldn't Emacs-22 already have suffered from
that same problem?
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #60 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Doesn't look too terrible, but I'd first want to understand why we're
> only seeing this now. Shouldn't Emacs-22 already have suffered from
> that same problem?
I think so. IIRC the stereotypical answer to this was something like
"get yourself another mouse-driver, another mouse, ...".
martin, who didn't try to reinvent the mouse-wheel.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#998
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #65 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> Doesn't look too terrible, but I'd first want to understand why we're
>> only seeing this now. Shouldn't Emacs-22 already have suffered from
>> that same problem?
> I think so. IIRC the stereotypical answer to this was something like
> "get yourself another mouse-driver, another mouse, ...".
Yes, that sounds like a better fix than your workaround,
Stefan
Tags added: wontfix, patch
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> emacsbugs.donarmstrong.com
.
(Tue, 02 Dec 2008 06:00:03 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
998 <at> debbugs.gnu.org and Davide Viti <zinosat <at> tiscali.it>
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 02 Aug 2011 16:03:01 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 31 Aug 2011 11:24:05 GMT)
Full text and
rfc822 format available.
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.