workspacesView: Fix scroll direction in RTL locales
Scrolling up or down (using the mouse wheel) should scroll to right or left respectively (rather than the other way around). Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1608>
This commit is contained in:
parent
151a104f9a
commit
698e67c486
@ -787,18 +787,23 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
|
|
||||||
let workspaceManager = global.workspace_manager;
|
let workspaceManager = global.workspace_manager;
|
||||||
const vertical = workspaceManager.layout_rows === -1;
|
const vertical = workspaceManager.layout_rows === -1;
|
||||||
|
const rtl = this.text_direction === Clutter.TextDirection.RTL;
|
||||||
let activeWs = workspaceManager.get_active_workspace();
|
let activeWs = workspaceManager.get_active_workspace();
|
||||||
let ws;
|
let ws;
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case Clutter.ScrollDirection.UP:
|
case Clutter.ScrollDirection.UP:
|
||||||
if (vertical)
|
if (vertical)
|
||||||
ws = activeWs.get_neighbor(Meta.MotionDirection.UP);
|
ws = activeWs.get_neighbor(Meta.MotionDirection.UP);
|
||||||
|
else if (rtl)
|
||||||
|
ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT);
|
||||||
else
|
else
|
||||||
ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT);
|
ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT);
|
||||||
break;
|
break;
|
||||||
case Clutter.ScrollDirection.DOWN:
|
case Clutter.ScrollDirection.DOWN:
|
||||||
if (vertical)
|
if (vertical)
|
||||||
ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN);
|
ws = activeWs.get_neighbor(Meta.MotionDirection.DOWN);
|
||||||
|
else if (rtl)
|
||||||
|
ws = activeWs.get_neighbor(Meta.MotionDirection.LEFT);
|
||||||
else
|
else
|
||||||
ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT);
|
ws = activeWs.get_neighbor(Meta.MotionDirection.RIGHT);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user