Skip to content

Commit

Permalink
account for RTL layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Pjsrcool committed Jul 23, 2024
1 parent 2ce8726 commit b8ef4cd
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1757,12 +1757,20 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
/* Accounts for mirrored RTL layout.
Switches between left/right key presses */
if(St.Widget.get_default_direction() === St.TextDirection.RTL) {
// QUESTION: Do we need to flip for the numpad arrows too?
if(symbol === Clutter.KEY_Right) {
symbol = Clutter.KEY_Left;
} else if(symbol === Clutter.KEY_Left) {
symbol = Clutter.KEY_Right;
}
switch(symbol) {
case Clutter.KEY_Right:
symbol = Clutter.KEY_Left;
break;
case Clutter.KEY_KP_Right:
symbol = Clutter.KEY_RP_Left;
break;
case Clutter.KEY_Left:
symbol = Clutter.KEY_Right;
break;
case Clutter.KEY_KP_Left:
symbol = Clutter.KEY_KP_Right;
break;
}
}

/* check for a keybinding and quit early, otherwise we get a double hit
Expand Down

0 comments on commit b8ef4cd

Please sign in to comment.