Skip to content

feat: add XKB settings to input manager - #116

Merged
zccrs merged 1 commit into
linuxdeepin:masterfrom
zzxyb:xkb
Sep 22, 2026
Merged

zccrs merged 1 commit into
linuxdeepin:masterfrom
zzxyb:xkb

Conversation

@zzxyb

@zzxyb zzxyb commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds XKB layout, model, variant, and options configuration to treeland_keyboard_settings_v1, including corresponding state events.

The new requests and events are introduced in interface version 2 while preserving compatibility with existing clients.

Log: add xkb settings to input manager
PMS: BUG-377251
Influence: Compatible change

Summary by Sourcery

Extend keyboard settings with versioned XKB rules configuration and state reporting.

New Features:

  • Add XKB layout, model, variant, and options configuration to keyboard settings, with corresponding state notifications.

Enhancements:

  • Version the input manager and keyboard settings interfaces to support the new XKB configuration while preserving compatibility with existing clients.

Documentation:

  • Update input manager protocol documentation to describe XKB keyboard mapping configuration.

@zzxyb
zzxyb requested review from Groveer, wineee and zccrs September 21, 2026 07:16
@sourcery-ai

sourcery-ai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Adds version-2 XKB layout, model, variant, and options configuration to keyboard settings, with atomic pending updates and state-reporting events, while preserving compatibility through versioned protocol additions and updated documentation.

Sequence diagram for XKB keyboard settings update and state reporting

sequenceDiagram
    participant Client
    participant KeyboardSettings as KeyboardSettings_v2
    participant Compositor

    Compositor->>KeyboardSettings: xkb_rules(layout, model, variant, options)
    Client->>KeyboardSettings: set_xkb_rules(layout, model, variant, options)
    Client->>KeyboardSettings: apply()
    KeyboardSettings->>Compositor: apply pending XKB rules snapshot
    Compositor-->>KeyboardSettings: xkb_rules(layout, model, variant, options)
    KeyboardSettings-->>Client: xkb_rules(layout, model, variant, options)
Loading

File-Level Changes

Change Details Files
Extend keyboard settings with configurable and observable XKB rules.
  • Add a version-2 request to replace pending layout, model, variant, and options as one snapshot.
  • Define replacement semantics for repeated requests and clarify default/empty values.
  • Add an initial and change-notification event reporting the effective XKB rules consistently.
dde/treeland-input-manager-unstable-v1.xml
Version the input protocol interfaces while retaining existing version-1 functionality.
  • Raise the input manager and keyboard settings interface versions to 2.
  • Gate new XKB request and event members with since="2" for compatibility with existing clients.
dde/treeland-input-manager-unstable-v1.xml
Update protocol documentation to describe XKB keymap support.
  • Document XKB settings in the input manager protocol inventory.
  • Add the same capability description to the Chinese documentation.
dde/README.md
dde/README.zh_CN.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@zzxyb
zzxyb marked this pull request as draft September 21, 2026 07:17
Adds XKB layout, model, variant, and options configuration to
treeland_keyboard_settings_v1, including corresponding state events.

The new requests and events are introduced in interface version 2
while preserving compatibility with existing clients.

Log: add xkb settings to input manager
PMS: BUG-377251
Influence: Compatible change
@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zccrs
zccrs marked this pull request as ready for review September 22, 2026 07:56
@zccrs
zccrs added this pull request to the merge queue Sep 22, 2026
Merged via the queue into linuxdeepin:master with commit 7aff2bf Sep 22, 2026
4 of 5 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="dde/treeland-input-manager-unstable-v1.xml" line_range="790-797" />
<code_context>
+                request, does not by itself cause an xkb_rules event to be
+                emitted.
+            </description>
+            <arg name="layout" type="string" allow-null="true"
+                 summary="comma-separated XKB layout names, or empty for the default"/>
+            <arg name="model" type="string" allow-null="true"
+                 summary="XKB keyboard model, or empty for the default"/>
+            <arg name="variant" type="string" allow-null="true"
+                 summary="comma-separated XKB variants, or empty for none"/>
+            <arg name="options" type="string" allow-null="true"
+                 summary="comma-separated XKB options, or empty for none"/>
+        </request>
+
</code_context>
<issue_to_address>
**issue (bug_risk):** All four request arguments are declared nullable, but the protocol defines semantics only for empty strings and never specifies what a null layout, model, variant, or options value means. Clients that send the valid null form therefore cannot interoperate reliably, because compositors can interpret it differently from the documented empty-string defaults.

**Triggers:** When a client uses null for one or more XKB rules arguments.

**Suggested fix:** Either remove `allow-null="true"` and require the documented empty-string representation, or explicitly define null semantics for every argument and make the `xkb_rules` event representation consistent.

```suggestion
            <arg name="layout" type="string"
                 summary="comma-separated XKB layout names, or empty for the default"/>
            <arg name="model" type="string"
                 summary="XKB keyboard model, or empty for the default"/>
            <arg name="variant" type="string"
                 summary="comma-separated XKB variants, or empty for none"/>
            <arg name="options" type="string"
                 summary="comma-separated XKB options, or empty for none"/>
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +790 to +797
<arg name="layout" type="string" allow-null="true"
summary="comma-separated XKB layout names, or empty for the default"/>
<arg name="model" type="string" allow-null="true"
summary="XKB keyboard model, or empty for the default"/>
<arg name="variant" type="string" allow-null="true"
summary="comma-separated XKB variants, or empty for none"/>
<arg name="options" type="string" allow-null="true"
summary="comma-separated XKB options, or empty for none"/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): All four request arguments are declared nullable, but the protocol defines semantics only for empty strings and never specifies what a null layout, model, variant, or options value means. Clients that send the valid null form therefore cannot interoperate reliably, because compositors can interpret it differently from the documented empty-string defaults.

Triggers: When a client uses null for one or more XKB rules arguments.

Suggested fix: Either remove allow-null="true" and require the documented empty-string representation, or explicitly define null semantics for every argument and make the xkb_rules event representation consistent.

Suggested change
<arg name="layout" type="string" allow-null="true"
summary="comma-separated XKB layout names, or empty for the default"/>
<arg name="model" type="string" allow-null="true"
summary="XKB keyboard model, or empty for the default"/>
<arg name="variant" type="string" allow-null="true"
summary="comma-separated XKB variants, or empty for none"/>
<arg name="options" type="string" allow-null="true"
summary="comma-separated XKB options, or empty for none"/>
<arg name="layout" type="string"
summary="comma-separated XKB layout names, or empty for the default"/>
<arg name="model" type="string"
summary="XKB keyboard model, or empty for the default"/>
<arg name="variant" type="string"
summary="comma-separated XKB variants, or empty for none"/>
<arg name="options" type="string"
summary="comma-separated XKB options, or empty for none"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants