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 729064 - Fix issues in the app grid with touch
Fix issues in the app grid with touch
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 728365 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-04-27 15:33 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2014-04-28 22:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
appDisplay: Remove redundant checks for pageNumber (1.47 KB, patch)
2014-04-27 15:33 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
appDisplay: Fix pages getting "stuck" under touch (1.78 KB, patch)
2014-04-27 15:33 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
appDisplay: Make page panning smoother on touch (2.94 KB, patch)
2014-04-27 15:33 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2014-04-27 15:33:13 UTC
This fixes issues with the app grid I noticed when testing
gnome-shell on my fancy new touch laptop.
Comment 1 Jasper St. Pierre (not reading bugmail) 2014-04-27 15:33:16 UTC
Created attachment 275266 [details] [review]
appDisplay: Remove redundant checks for pageNumber

We already do these at the beginning of the function.
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-04-27 15:33:21 UTC
Created attachment 275267 [details] [review]
appDisplay: Fix pages getting "stuck" under touch

We often call goToPage like:

  this.goToPage(this._currentPage - 1);

(or + 1). During panning, these are based on the velocity values
of the gesture action. If we're already on the first or last page
and the panning ends, it's possible to get goToPage that's either
-1 or greater than the last page.

During normal usage, this isn't a problem, since the Y values will
be correct, always. But when panning, the Y values stick to the
finger, and thus if we return early, we won't snap to the exact page,
making it seem like things get "stuck".

Fix this the simple way by clamping to the correctly-ranged values
of pageNumber
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-04-27 15:33:25 UTC
Created attachment 275268 [details] [review]
appDisplay: Make page panning smoother on touch

Currently, our logic for page panning isn't great. If the user starts a
pan upwards and hesitates over a new page, we'll go to the *next* page
on release, since the difference is greater, but the velocity wound down
to 0.

Instead of trying to treat it like page down or scrolls, simply do the
math to find the page where the user scrolled to.

This is unfortunately broken for fast swipes, since the user doesn't get
far enough into the new page to make a difference. I'm getting the
impression we'll need a gesture recognizer for this, though, however
crude. Simple hacks I tried, like a velocity multiplier, didn't work
properly.
Comment 4 Carlos Soriano 2014-04-28 13:40:44 UTC
Review of attachment 275266 [details] [review]:

ups right
Comment 5 Carlos Soriano 2014-04-28 13:43:06 UTC
Review of attachment 275267 [details] [review]:

oh right, I overkilled this.
Comment 6 Carlos Soriano 2014-04-28 13:54:26 UTC
Review of attachment 275268 [details] [review]:

::: js/ui/appDisplay.js
@@ +535,3 @@
+
+        let velocity = -action.get_velocity(0)[2];
+        let endPanValue = this._adjustment.value + velocity;

How about taking into account acceleration too?
In this manner fast swipes would work too.

::: js/ui/iconGrid.js
@@ +649,3 @@
+        return this._availableHeightPerPageForItems();
+    },
+

Florian,

Do you remember why we did _availableHeightPerPageForItems private? I remember I had that public.
Comment 7 Carlos Soriano 2014-04-28 13:57:45 UTC
fwiw this is a previous work I did for taking acceleration into account (in this case for touchapd devices)
Basically I do a median of few delta values, and calculate acceleration of that.
https://bug707973.bugzilla-attachments.gnome.org/attachment.cgi?id=254782
Comment 8 Florian Müllner 2014-04-28 13:58:45 UTC
(In reply to comment #6)
> Do you remember why we did _availableHeightPerPageForItems private? I remember
> I had that public.

I don't, but my guess would be that nothing outside of PaginatedIconGrid needed it.
Comment 9 Carlos Soriano 2014-04-28 16:10:15 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Do you remember why we did _availableHeightPerPageForItems private? I remember
> > I had that public.
> 
> I don't, but my guess would be that nothing outside of PaginatedIconGrid needed
> it.

Then maybe this should be changed to getPageHeight for simplicity.

Although it is not true at all, since the page height is the height of the rows with at least one item. So for example last page probably won't have a entire filled page. That's why it is named availableHeightPerPageForItems and not getPageHeight in the first place.

Not very strong about that, fine to push as is for me.
Comment 10 Florian Müllner 2014-04-28 22:16:39 UTC
*** Bug 728365 has been marked as a duplicate of this bug. ***