gala icon indicating copy to clipboard operation
gala copied to clipboard

Implement different keyboard layouts for individual windows

Open lenemter opened this issue 9 months ago • 6 comments

Fixes https://github.com/elementary/gala/issues/180

lenemter avatar May 08 '25 15:05 lenemter

@leonardo-lemos what do you mean 'Gala always reverts the layout to the first one'? It works fine for me

lenemter avatar May 17 '25 08:05 lenemter

@lenemter There are two problems to me:

  1. I can't change layout using the keyboard indicator, because if I'm using a layout A in a window and try to change to a layout B, the indicator always reverts state to layout A
  2. If I'm using terminal with layout A and and code with layout A, then go back to terminal and change to layout B using a keyboard shortcut, code will be set to use layout B too.

leonardo-lemos avatar May 17 '25 15:05 leonardo-lemos

@leonardo-lemos I fixed interaction with the keyboard indicator. But I cannot reproduce the second issue you have. Can you check again now, maybe it got fixed on your side?

lenemter avatar May 19 '25 21:05 lenemter

@lenemter It works as expected when changing layouts using the indicator, but doesn't work properly when changing layouts using the keyboard (using the change layout shortcut). When I change layout using the shortcut, it changes layout for all the windows.

leonardo-lemos avatar May 20 '25 17:05 leonardo-lemos

@leonardo-lemos Can you provide steps to reproduce? It works fine for me ¯\_(ツ)_/¯

lenemter avatar Jun 09 '25 15:06 lenemter

@lenemter Sure

https://github.com/user-attachments/assets/10e1c6a3-dfc9-466b-90ed-2113efbccb95

  1. Make sure you have two keyboard layouts enabled: Portuguese (Brazil) and English (US).
  2. Open a window (e.g., a text editor or browser) with the English (US) layout active.
  3. Type something. In my case, I pressed the ´ key on my pt-br keyboard, which corresponds to [ in the en-us layout.
  4. Switch to a different window.
  5. Change the keyboard layout using the keyboard shortcut (e.g., Alt + Shift).
  6. Confirm that the layout has switched to pt-br. Type ´ and verify that it appears correctly on the screen.
  7. Return to the first window. You'll see that the keyboard layout has also changed to pt-br, even though it was previously set to en-us.

This seems to be an issue with Gala or the keyboard layout indicator, rather than something caused by the changes in this PR. Could you confirm?

leonardo-lemos avatar Jun 09 '25 16:06 leonardo-lemos