From 4e70315fbb7a4ee88bd5ce1d789d6735da450975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 29 Jan 2024 17:41:54 +0100 Subject: [PATCH] boxpointer: Swap arrow alignment on RTL The current code uses the arrow alignment to align the menu between the top/left (0) and bottom/right(1), regardless of the text direction. Instead of adjusting code everywhere, reinterpret the parameter to refer to start/end instead, and swap the alignment with an RTL text direction. Credit to Sebastian Keller for spotting the cause of the issue. Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5261 Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7356 Part-of: --- js/ui/boxpointer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 53433245d..8c410201e 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -533,6 +533,9 @@ export const BoxPointer = GObject.registerClass({ switch (this._arrowSide) { case St.Side.TOP: case St.Side.BOTTOM: + if (this.text_direction === Clutter.TextDirection.RTL) + alignment = 1.0 - alignment; + resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment); resX = Math.max(resX, workarea.x + padding);