Skip to content

Avoid weird jumping around text when GtkEntry focused + GtkSpinButton always LTR

Jehan requested to merge wip/Jehan/gimp-issue-7944-gtk4 into main

This is the GTK4/main repository pendant of MR !4629 (closed). There are 2 commits:

  1. The first commit is to get rid of some historical code which was provoking weird behavior of GtkEntry text which could jump right to left when the contents is considered "neutral direction" (e.g. numbers only), when the widget gets focused and suddenly using the keyboard direction. This is unsettling, breaks UI expectations and does not seem backed by any good reason.
  2. The second commit makes the entry in a GtkSpinButton always LTR, even when the whole GUI is RTL (the spin button's buttons are on the left, as expected, but the entry part behaves the same as in LTR). This is because numeric fields should always be aligned left, even for RTL languages, per @danialbehzadi's comment.

I hope it's good enough for merging now. I would love this MR (and the GTK+3 version !4629 (closed)) to be merged before we release GIMP 3.0.0 so that our custom spin button (relying on GTK one) gets "unbroken" in RTL languages.

Note that I tested this MR with the gtk4-widget-factory demo tool and it looks to me like it now behaves exactly how it should. No more weird jumping around in RTL, and spin button field always LTR.

Merge request reports

Loading