Implement different keyboard layouts for individual windows
Fixes https://github.com/elementary/gala/issues/180
@leonardo-lemos what do you mean 'Gala always reverts the layout to the first one'? It works fine for me
@lenemter There are two problems to me:
- 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
- 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 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 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 Can you provide steps to reproduce? It works fine for me ¯\_(ツ)_/¯
@lenemter Sure
https://github.com/user-attachments/assets/10e1c6a3-dfc9-466b-90ed-2113efbccb95
- Make sure you have two keyboard layouts enabled: Portuguese (Brazil) and English (US).
- Open a window (e.g., a text editor or browser) with the English (US) layout active.
- Type something. In my case, I pressed the ´ key on my pt-br keyboard, which corresponds to [ in the en-us layout.
- Switch to a different window.
- Change the keyboard layout using the keyboard shortcut (e.g., Alt + Shift).
- Confirm that the layout has switched to pt-br. Type ´ and verify that it appears correctly on the screen.
- 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?