After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 665383 - Nautilus autoscroll broken on maximized window
Nautilus autoscroll broken on maximized window
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 664020 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-12-02 11:01 UTC by Nelson Benitez
Modified: 2011-12-05 02:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
icon-container: use a threshold to start scrolling while rubberbanding (2.24 KB, patch)
2011-12-02 19:39 UTC, Rui Matos
reviewed Details | Review
icon-container: use a threshold to start scrolling while rubberbanding (1.94 KB, patch)
2011-12-05 01:25 UTC, Rui Matos
committed Details | Review

Description Nelson Benitez 2011-12-02 11:01:10 UTC
Hi,
I've done some investigation on nautilus bug 664020 and the bug appears in gnome-shell with mutter but it is working well in fallback mode(metacity). 

Looking at the code[1], nautilus starts the autoscroll when the mouse pointer 'y coordinate' is >= allocation.height of the container widget (icon view). That condition have been working well both in metacity and in mutter in non-maximized window, but in mutter with maximized window the mouse pointer can't reach the allocation.height, in my tests it can't reach it by 1 unit. 

So it seems a one pixel difference that brokes nautilus autoscroll.

I could help with any debugging if you need to.


[1] http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-icon-container.c#n2524  (slow to load)
Comment 1 Nelson Benitez 2011-12-02 11:06:30 UTC
Apart from nautilus, this could break other programs that rely on the mouse pointer 'y coordinate' reaching the allocation.height of the widget.
Comment 2 Christian Persch 2011-12-02 12:32:04 UTC
(In reply to comment #0)
> Hi,
> I've done some investigation on nautilus bug 664020 and the bug appears in
> gnome-shell with mutter but it is working well in fallback mode(metacity). 

Actually for me, this occurs in fallback mode (haven't even tested with shell).
Comment 3 Rui Matos 2011-12-02 14:58:20 UTC
This is a nautilus bug.
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-12-02 15:40:32 UTC
(In reply to comment #3)
> This is a nautilus bug.

Isn't it the message tray that keeps applications from getting the last row of pixels?
Comment 5 Rui Matos 2011-12-02 19:39:49 UTC
Created attachment 202648 [details] [review]
icon-container: use a threshold to start scrolling while rubberbanding

This allows us to scroll while rubberbanding when the window is maximized and
thus the pointer can't possibly leave the widget area.

--

(In reply to comment #4)
> Isn't it the message tray that keeps applications from getting the last row of
> pixels?

Nope. It's because the logic used to scroll while rubberbanding in the widget
doesn't take into account that the widget might just be at a screen's edge.
Comment 6 Cosimo Cecchi 2011-12-02 22:24:57 UTC
Review of attachment 202648 [details] [review]:

I like the idea of this patch; a little comment below.
Another approach would be explicitly checking for pointer_x and pointer_y being close to gdk_screen_get_width/height, but yours is probably better.

::: libnautilus-private/nautilus-icon-container.c
@@ +2529,3 @@
+	if (x < RUBBERBAND_SCROLL_THRESHOLD) {
+		x_scroll = x - RUBBERBAND_SCROLL_THRESHOLD;
+		x_scroll = MAX (- (x_scroll * x_scroll), - RUBBERBAND_SCROLL_MAX);

Is this quadratic transformation there to make the scroll a bit smoother when the pointer is much far away from the widget limit?
There should be a comment saying the purpose of this if so.
Comment 7 Cosimo Cecchi 2011-12-02 22:26:46 UTC
*** Bug 664020 has been marked as a duplicate of this bug. ***
Comment 8 Rui Matos 2011-12-05 01:25:00 UTC
Created attachment 202784 [details] [review]
icon-container: use a threshold to start scrolling while rubberbanding

--

(In reply to comment #6)
> Another approach would be explicitly checking for pointer_x and pointer_y being
> close to gdk_screen_get_width/height, but yours is probably better.

Yeah, that could even allow us to scroll while the widget bounds are outside
the screen dimensions but meh... just move the window already! :-)

> ::: libnautilus-private/nautilus-icon-container.c
> @@ +2529,3 @@
> +    if (x < RUBBERBAND_SCROLL_THRESHOLD) {
> +        x_scroll = x - RUBBERBAND_SCROLL_THRESHOLD;
> +        x_scroll = MAX (- (x_scroll * x_scroll), - RUBBERBAND_SCROLL_MAX);
>
> Is this quadratic transformation there to make the scroll a bit smoother when
> the pointer is much far away from the widget limit?
> There should be a comment saying the purpose of this if so.

So, after trying it a bit more I decided this isn't really needed. The
scrolling is slower without it on the bug report use case but it works. If
people really want it, it can go in another patch.

FWIW, Apple's Finder doesn't handle this case nor the above mentioned widget
outside screen bounds either.
Comment 9 Cosimo Cecchi 2011-12-05 02:01:08 UTC
Review of attachment 202784 [details] [review]:

Looks good, thanks (and I agree on keeping this simple).
Comment 10 Rui Matos 2011-12-05 02:24:49 UTC
Rebased and pushed.

Attachment 202784 [details] pushed as 896a9cf - icon-container: use a threshold to start scrolling while rubberbanding