* bug#5654: Even slightest scrollbar move warping point
@ 2010-02-27 14:39 David De La Harpe Golden
2010-02-28 11:41 ` Jan Djärv
0 siblings, 1 reply; 5+ messages in thread
From: David De La Harpe Golden @ 2010-02-27 14:39 UTC (permalink / raw)
To: 5654
Don't actually use the scrollbar very much, so not presently sure if
this was just always the way emacs acted and I simply didn't notice, but
right now (23.1.93), if you "move the scrollbar" a tiny bit (not enough
to actually visibly scroll the buffer), the point warps to the top of
the window.
recipe:
* emacs -Q on X11, with gtk+ (debian libgtk 2.18.6-1) toolkit scrollbars:
place point somewhere other than start of buffer. (if you've just done
emacs -Q, it'll probably be at the end of the *scratch* buffer anyway).
mouse-1 down on scrollbar. move even a tiny amount, not enough to
scroll. If you've just done emacs -Q, it'll already be at the top, so
you could just push it against the top, which you might not expect to do
anything, really. Point warps to window start. This happens before
you mouse-1 up.
* emacs -Q on X11, with lucid with toolkit scrollbars: (i.e. 90s-looking
3d-effect scrollbar):
same as gtk+
* emacs -Q on X11, with lucid without toolkit scrollbars (i.e. flat
looking scrollbar):
no warp on mouse-1, but of course mouse-1 means something different for
these scrollbars - there is an immediate warp, but I think that's also
different since these scrollbars immediately scroll to a location
corresponding to the position on the scrollbar you mouse-2 down on. So
this case might be irrelevant and it's only something that's happening
for toolkit scrollbars.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#5654: Even slightest scrollbar move warping point
2010-02-27 14:39 bug#5654: Even slightest scrollbar move warping point David De La Harpe Golden
@ 2010-02-28 11:41 ` Jan Djärv
2010-02-28 13:49 ` Chong Yidong
2010-02-28 20:33 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: Jan Djärv @ 2010-02-28 11:41 UTC (permalink / raw)
To: David De La Harpe Golden; +Cc: 5654
It does not happen in 23.1.
Reverting this change:
2009-11-13 Stefan Monnier <monnier@iro.umontreal.ca>
* scroll-bar.el (scroll-bar-set-window-start, scroll-bar-drag-1)
(scroll-bar-maybe-set-window-start):
Use with-current-buffer.
fixes it. I don't know if that is the right thing to do.
Adding a save-excursion in scroll-bar-drag-1 also fixes it:
--- lisp/scroll-bar.el 2010-01-13 08:35:10 +0000
+++ lisp/scroll-bar.el 2010-02-28 11:41:09 +0000
@@ -211,12 +211,13 @@
(window (nth 0 start-position))
(portion-whole (nth 2 start-position)))
(with-current-buffer (window-buffer window)
+ (save-excursion
;; Calculate position relative to the accessible part of the buffer.
(goto-char (+ (point-min)
(scroll-bar-scale portion-whole
(- (point-max) (point-min)))))
(vertical-motion 0 window)
- (set-window-start window (point)))))
+ (set-window-start window (point))))))
(defun scroll-bar-drag (event)
"Scroll the window by dragging the scroll bar slider.
Jan D.
David De La Harpe Golden skrev:
> Don't actually use the scrollbar very much, so not presently sure if
> this was just always the way emacs acted and I simply didn't notice, but
> right now (23.1.93), if you "move the scrollbar" a tiny bit (not enough
> to actually visibly scroll the buffer), the point warps to the top of
> the window.
>
> recipe:
>
> * emacs -Q on X11, with gtk+ (debian libgtk 2.18.6-1) toolkit scrollbars:
>
> place point somewhere other than start of buffer. (if you've just done
> emacs -Q, it'll probably be at the end of the *scratch* buffer anyway).
>
> mouse-1 down on scrollbar. move even a tiny amount, not enough to
> scroll. If you've just done emacs -Q, it'll already be at the top, so
> you could just push it against the top, which you might not expect to do
> anything, really. Point warps to window start. This happens before
> you mouse-1 up.
>
>
> * emacs -Q on X11, with lucid with toolkit scrollbars: (i.e. 90s-looking
> 3d-effect scrollbar):
>
> same as gtk+
>
> * emacs -Q on X11, with lucid without toolkit scrollbars (i.e. flat
> looking scrollbar):
>
> no warp on mouse-1, but of course mouse-1 means something different for
> these scrollbars - there is an immediate warp, but I think that's also
> different since these scrollbars immediately scroll to a location
> corresponding to the position on the scrollbar you mouse-2 down on. So
> this case might be irrelevant and it's only something that's happening
> for toolkit scrollbars.
>
>
>
>
>
>
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#5654: Even slightest scrollbar move warping point
2010-02-28 11:41 ` Jan Djärv
@ 2010-02-28 13:49 ` Chong Yidong
2010-02-28 14:39 ` Jan Djärv
2010-02-28 20:33 ` Stefan Monnier
1 sibling, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2010-02-28 13:49 UTC (permalink / raw)
To: Jan Djärv; +Cc: 5654, David De La Harpe Golden
Jan Djärv <jan.h.d@swipnet.se> writes:
> Adding a save-excursion in scroll-bar-drag-1 also fixes it:
I think this is the right fix. Please check in, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#5654: Even slightest scrollbar move warping point
2010-02-28 13:49 ` Chong Yidong
@ 2010-02-28 14:39 ` Jan Djärv
0 siblings, 0 replies; 5+ messages in thread
From: Jan Djärv @ 2010-02-28 14:39 UTC (permalink / raw)
To: Chong Yidong; +Cc: 5654-done, David De La Harpe Golden
Chong Yidong skrev:
> Jan Djärv <jan.h.d@swipnet.se> writes:
>
>> Adding a save-excursion in scroll-bar-drag-1 also fixes it:
>
> I think this is the right fix. Please check in, thanks.
Done.
Jan D.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#5654: Even slightest scrollbar move warping point
2010-02-28 11:41 ` Jan Djärv
2010-02-28 13:49 ` Chong Yidong
@ 2010-02-28 20:33 ` Stefan Monnier
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2010-02-28 20:33 UTC (permalink / raw)
To: Jan Djärv; +Cc: 5654, David De La Harpe Golden
> Adding a save-excursion in scroll-bar-drag-1 also fixes it:
Thanks, that's indeed the right fix,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-02-28 20:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-27 14:39 bug#5654: Even slightest scrollbar move warping point David De La Harpe Golden
2010-02-28 11:41 ` Jan Djärv
2010-02-28 13:49 ` Chong Yidong
2010-02-28 14:39 ` Jan Djärv
2010-02-28 20:33 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.