summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-03-01 18:13:02 +0100
committerCarlos Garnacho <carlosg@gnome.org>2021-03-01 18:34:46 +0100
commitd7b82ad70c5457978667796eeee9adad5ec3d247 (patch)
tree4fe2c3cf9ede40364ec5d17213355ccbe8a688f3
parenta6588d054f4c4536174443736b37bb627b5e14e8 (diff)
downloadgnome-shell-wip/carlosg/appdisplay-dnd-rtl.tar.gz
appDisplay: Move onto the correct page while DnD on both LTR/RTLwip/carlosg/appdisplay-dnd-rtl
Look up the next page correctly for the overshoot coordinates, given the text direction. We don't need to look whether there is a next page either, as goToPage() checks that it's the case. Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3778
-rw-r--r--js/ui/appDisplay.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index dee7df300..c3958ae9c 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -475,13 +475,11 @@ var BaseAppView = GObject.registerClass({
if (this._lastOvershoot >= 0)
return;
- const currentPosition = this._adjustment.value;
- const maxPosition = this._adjustment.upper - this._adjustment.page_size;
-
- if (dragPosition <= gridStart && currentPosition > 0)
- this.goToPage(this._grid.currentPage - 1);
- else if (dragPosition >= gridEnd && currentPosition < maxPosition)
- this.goToPage(this._grid.currentPage + 1);
+ const rtl = this.get_text_direction() === Clutter.TextDirection.RTL;
+ if (dragPosition <= gridStart)
+ this.goToPage(this._grid.currentPage + (rtl ? 1 : -1));
+ else if (dragPosition >= gridEnd)
+ this.goToPage(this._grid.currentPage + (rtl ? -1 : 1));
else
return; // don't go beyond first/last page