Handle layout switching thru cinnamon, remove use of XApp.#477
Handle layout switching thru cinnamon, remove use of XApp.#477
Conversation
| for source in sources: | ||
| input_source = CurrentInputSource(source) | ||
| if input_source.type == "xkb": | ||
| self.sources.append(input_source) |
There was a problem hiding this comment.
The get_input_sources_callback method appends new input sources without clearing the existing list, which may cause duplicate entries on subsequent updates. Consider clearing self.sources (e.g., self.sources.clear()) before appending new entries.
There was a problem hiding this comment.
self.sources is initiated with = [] just above.
49467fa to
93b7b95
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR aims to update the layout switching mechanism by removing dependency on XApp and instead using Cinnamon’s dbus interface for managing keyboard layouts. Key changes include removing XAppKbdLayoutController usage, refactoring layout switching logic in the screensaver password entry, and implementing a new CinnamonClient to interact with Cinnamon’s input sources.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/singletons.py | Removed XAppKbdLayoutController and updated layout source usage; refactored event handlers. |
| src/passwordEntry.py | Updated layout icon rendering and input source change logic using CinnamonClient. |
| src/dbusdepot/cinnamonClient.py | Added signals for input source changes and implemented input source management. |
Files not reviewed (1)
- debian/control: Language not supported
Comments suppressed due to low confidence (2)
src/singletons.py:167
- [nitpick] The parameter name 'cinnamon' shadows the instance attribute 'self.cinnamon', which could lead to confusion. Consider renaming the parameter to avoid ambiguity.
def on_current_layout_changed(self, cinnamon):
src/singletons.py:176
- [nitpick] Similarly, the parameter 'cinnamon' shadows 'self.cinnamon'. Renaming the parameter (or not using it if unnecessary) would improve clarity.
def on_layout_sources_changed(self, cinnamon):
93b7b95 to
adb4a1e
Compare
fac2dff to
f06e8ad
Compare
ref: linuxmint/cinnamon#12758