add XKB settings to input manager - #1435
Merged
Merged
Conversation
Reviewer's GuideAdds versioned XKB rule support to keyboard settings, including normalized protocol transport, initialization and live application with seat-config persistence, plus command-line coverage in the test client. Sequence diagram for versioned XKB settings applicationsequenceDiagram
participant Client
participant KeyboardSettingsInterfaceV1
participant InputManager
participant SeatConfig
participant Seat
InputManager->>KeyboardSettingsInterfaceV1: sendXkbRules(layout, model, variant, options, true)
KeyboardSettingsInterfaceV1-->>Client: xkb_rules
Client->>KeyboardSettingsInterfaceV1: set_xkb_rules(layout, model, variant, options)
KeyboardSettingsInterfaceV1->>KeyboardSettingsInterfaceV1: apply()
KeyboardSettingsInterfaceV1->>InputManager: onKeyboardSettingsApplied(XkbRulesChanged)
InputManager->>SeatConfig: setXkbLayout(layout)
InputManager->>SeatConfig: setXkbModel(model)
InputManager->>SeatConfig: setXkbVariant(variant)
InputManager->>SeatConfig: setXkbOptions(options)
InputManager->>Seat: applyXkbConfig(seat, layout, model, variant, options)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Expose version 2 of treeland_input_manager_v1 and support configuring XKB layout, model, variant, and options as a single rules snapshot. Report the stored XKB rules when keyboard settings are created, persist applied protocol changes to seat DConfig, and apply them directly to the target seat. Normalize nullable protocol strings to empty values. Log: add XKB settings to input manager PMS: BUG-377251 Influence: Compatible change
Bind treeland_input_manager_v1 at version 2 and handle the xkb_rules state event in the input manager example client. Add command-line options for XKB layout, model, variant, and options. Send them as a single rules snapshot through set_xkb_rules and apply the configuration to exercise the version 2 protocol path. Log: add XKB rules test to input manager example PMS: BUG-377251 Influence: Compatible change
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/input/inputmanager.cpp" line_range="105-113" />
<code_context>
applyXkbConfigForSeat(seat);
- connect(config, &SeatUserDConfig::xkbLayoutChanged, this,
- [this, seat] { applyXkbConfigForSeat(seat); });
- connect(config, &SeatUserDConfig::xkbModelChanged, this,
- [this, seat] { applyXkbConfigForSeat(seat); });
- connect(config, &SeatUserDConfig::xkbVariantChanged, this,
- [this, seat] { applyXkbConfigForSeat(seat); });
- connect(config, &SeatUserDConfig::xkbOptionsChanged, this,
- [this, seat] { applyXkbConfigForSeat(seat); });
-
const auto devices = seat->deviceList();
for (WInputDevice *device : devices)
</code_context>
<issue_to_address>
**issue (broader_impact):** XKB configuration changes made through seat DConfig no longer trigger `applyXkbConfigForSeat`; the removed signal connections were the only live-update path after initial seat setup, so external configuration changes are persisted but not applied to the target seat until a later seat reinitialization.
**Triggers:** When a seat's XKB layout, model, variant, or options are changed through DConfig rather than through the new Wayland protocol.
**Suggested fix:** Retain the four DConfig change-signal connections, or replace them with an equivalent connection that reapplies the complete XKB rules snapshot when any XKB setting changes.
</issue_to_address>
zccrs
approved these changes
Sep 22, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zccrs, zzxyb The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Collaborator
Author
|
相关协议变动pr:linuxdeepin/treeland-protocols#116 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add XKB keyboard rules support to the input manager and apply client-requested changes to the active seat.
New Features:
Enhancements:
Chores: