GNOME Bugzilla – Bug 665383
Nautilus autoscroll broken on maximized window
Last modified: 2011-12-05 02:24:51 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)
Apart from nautilus, this could break other programs that rely on the mouse pointer 'y coordinate' reaching the allocation.height of the widget.
(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).
This is a nautilus bug.
(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?
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.
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.
*** Bug 664020 has been marked as a duplicate of this bug. ***
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.
Review of attachment 202784 [details] [review]: Looks good, thanks (and I agree on keeping this simple).
Rebased and pushed. Attachment 202784 [details] pushed as 896a9cf - icon-container: use a threshold to start scrolling while rubberbanding