Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dde/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ For DDE desktop components. Installed via `TREELAND_PROTOCOL_DDE_XML_FILES`.
| File | Protocol | Interfaces | Purpose |
|------|----------|-----------|---------|
| `treeland-foreign-toplevel-manager-unstable-v2.xml` | `treeland_foreign_toplevel_manager_unstable_v2` | `treeland_foreign_toplevel_manager_v2`, `treeland_foreign_toplevel_handle_v2`, `treeland_dock_preview_context_v2` | Redesigned toplevel observation and dock preview; fixes naming, member ordering, destroy placement, and description quality relative to v1 |
| `treeland-input-manager-unstable-v1.xml` | `treeland_input_manager_unstable_v1` | `treeland_input_manager_v1`, `treeland_pointer_device_configuration_v1`, `treeland_mouse_settings_v1`, `treeland_touchpad_settings_v1`, `treeland_keyboard_settings_v1` | Per-device input configuration: pointer acceleration, send-events mode, keyboard toggle state |
| `treeland-input-manager-unstable-v1.xml` | `treeland_input_manager_unstable_v1` | `treeland_input_manager_v1`, `treeland_pointer_device_configuration_v1`, `treeland_mouse_settings_v1`, `treeland_touchpad_settings_v1`, `treeland_keyboard_settings_v1` | Per-device input configuration: pointer acceleration, send-events mode, keyboard toggle state, and XKB keymap settings |
| `treeland-keyboard-state-notify-unstable-v1.xml` | `treeland_keyboard_state_notify_unstable_v1` | `treeland_keyboard_state_notify_manager_v1`, `treeland_keyboard_state_watcher_v1` | Watch keyboard modifier (caps/num lock) state changes |
| `treeland-output-manager-unstable-v2.xml` | `treeland_output_manager_unstable_v2` | `treeland_output_manager_v2`, `treeland_output_picture_control_v2` | Primary output designation, per-output color temperature and brightness control |
| `treeland-shortcut-manager-unstable-v3.xml` | `treeland_shortcut_manager_unstable_v3` | `treeland_shortcut_manager_v3`, `treeland_shortcut_capture_v3` | Global keyboard shortcut binding with key/touch/multi-touch gesture support and one-shot shortcut capture |
Expand Down
2 changes: 1 addition & 1 deletion dde/README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| 文件 | 协议 | 接口 | 用途 |
|------|----------|-----------|---------|
| `treeland-foreign-toplevel-manager-unstable-v2.xml` | `treeland_foreign_toplevel_manager_unstable_v2` | `treeland_foreign_toplevel_manager_v2`, `treeland_foreign_toplevel_handle_v2`, `treeland_dock_preview_context_v2` | 重新设计的顶层窗口观察和 Dock 预览;修正了命名、成员顺序、destroy 位置和描述质量 |
| `treeland-input-manager-unstable-v1.xml` | `treeland_input_manager_unstable_v1` | `treeland_input_manager_v1`, `treeland_pointer_device_configuration_v1`, `treeland_mouse_settings_v1`, `treeland_touchpad_settings_v1`, `treeland_keyboard_settings_v1` | 逐设备输入配置:指针加速、发送事件模式、键盘切换状态 |
| `treeland-input-manager-unstable-v1.xml` | `treeland_input_manager_unstable_v1` | `treeland_input_manager_v1`, `treeland_pointer_device_configuration_v1`, `treeland_mouse_settings_v1`, `treeland_touchpad_settings_v1`, `treeland_keyboard_settings_v1` | 逐设备输入配置:指针加速、发送事件模式、键盘切换状态与 XKB 键盘映射设置 |
| `treeland-keyboard-state-notify-unstable-v1.xml` | `treeland_keyboard_state_notify_unstable_v1` | `treeland_keyboard_state_notify_manager_v1`, `treeland_keyboard_state_watcher_v1` | 监听键盘修饰键(Caps/Num Lock)状态变化 |
| `treeland-output-manager-unstable-v2.xml` | `treeland_output_manager_unstable_v2` | `treeland_output_manager_v2`, `treeland_output_picture_control_v2` | 指定主屏、逐输出色温和亮度控制 |
| `treeland-shortcut-manager-unstable-v3.xml` | `treeland_shortcut_manager_unstable_v3` | `treeland_shortcut_manager_v3`, `treeland_shortcut_capture_v3` | 全局键盘快捷键绑定,支持按键/触摸/多点触摸手势及一次性快捷键捕获 |
Expand Down
68 changes: 65 additions & 3 deletions dde/treeland-input-manager-unstable-v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
treeland_pointer_device_configuration_v1 object created from the
device-specific settings interface.

Keyboard settings include repeat behavior, num lock state, and XKB
layout, model, variant, and option strings for the target seat.

Warning! This protocol is EXPERIMENTAL and under active development.
It may change at any time, including in backward-incompatible ways,
without incrementing the interface major version and without prior
Expand All @@ -29,7 +32,7 @@
semantics remaining stable across releases.
</description>

<interface name="treeland_input_manager_v1" version="1">
<interface name="treeland_input_manager_v1" version="2">
<description summary="global input device manager">
The treeland_input_manager_v1 interface is a global object used to
create per-device settings objects for input devices exposed by the
Expand Down Expand Up @@ -677,10 +680,10 @@
</request>
</interface>

<interface name="treeland_keyboard_settings_v1" version="1">
<interface name="treeland_keyboard_settings_v1" version="2">
<description summary="keyboard settings object">
The treeland_keyboard_settings_v1 interface represents pending
settings for all keyboard associated with the target seat.
settings for all keyboards associated with the target seat.

Requests on this object update pending keyboard state. The
compositor applies the accumulated settings when the client sends
Expand Down Expand Up @@ -756,6 +759,44 @@
</description>
</request>

<request name="set_xkb_rules" since="2">
<description summary="set the pending XKB rules configuration">
Set the XKB layout, model, variant, and options to apply on the
next apply request. These four values form one configuration
snapshot and replace the complete pending XKB rules state.

Layout contains one or more comma-separated layout names, for
example "us" or "cz,us". An empty layout selects the XKB
default layout, which is "us".

Model identifies the keyboard model, for example "pc104" or
"pc105". An empty model selects the XKB default model.

Variant contains a comma-separated list whose entries
correspond to the layouts, for example "" or ",dvorak".
Empty entries select no variant for the corresponding layout.

Options contains a comma-separated list of XKB options, for
example "grp:win_space_toggle". An empty options string
selects no extra options.

This request updates only the pending state tracked by this
object. Multiple calls before apply replace the complete
pending XKB rules configuration; only the last configuration
is applied. Sending this request, or the following apply
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"/>
Comment on lines +790 to +797

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"/>

</request>

<event name="feature">
<description summary="report supported keyboard features">
This event reports which optional features are supported by at
Expand Down Expand Up @@ -824,5 +865,26 @@
state or a later update.
</description>
</event>

<event name="xkb_rules" since="2">
<description summary="report the current XKB rules configuration">
This event reports the current XKB layout, model, variant, and
options as one consistent configuration snapshot. The string
formats and empty-value semantics match set_xkb_rules.

The compositor sends this event after object creation as part
of the initial keyboard state batch. It may send the event
again in a later batch when any effective XKB rules value
changes.
</description>
<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"/>
</event>
</interface>
</protocol>
Loading