Skip to content

x11: add ui-events-x11 adapter and shared ui-events-xkb crate - #125

Merged
xorgy merged 1 commit into
forest-rs:mainfrom
xorgy:x11-adapter
Aug 21, 2026
Merged

xorgy merged 1 commit into
forest-rs:mainfrom
xorgy:x11-adapter

Conversation

@xorgy

@xorgy xorgy commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Add ui-events-x11, an adapter bridging X11 input into the ui-events model with host-clocked keyboard, pointer, and touch reducers.
It assumes XInput 2 and XKB, with no legacy core fallbacks.

Factor the XKB keysym and keymap code out of ui-events-wayland into a shared ui-events-xkb crate, used by both adapters.

Since the xkb feature links libxkbcommon, restrict all-features CI for these crates to the Linux runners that install it.

@xorgy
xorgy force-pushed the x11-adapter branch 2 times, most recently from f831baf to 3a3730a Compare July 20, 2026 23:20

@waywardmonkeys waywardmonkeys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some comments, mostly from Codex but they seem mostly right.

Should add tests for some of these things:

  • Two simultaneous nearby touches both start with count 1 and retain correct Up counts.
  • Left-click followed by right-click does not become a double-click.
  • Primary lifts, secondary remains, third touch remains non-primary.
  • Shift/Ctrl modifiers propagate into mouse and touch states.
  • FocusOut releases held keys and clears modifiers.
  • Two sourceids maintain independent scroll configurations and baselines.
  • Non-emulated wheel buttons, dead keys, compose sequences, and XIM commit/preedit.
  • A Linux/Xvfb smoke test covering real XI2 event selection and device discovery.

Comment thread ui-events-x11/src/tap.rs Outdated
Comment thread ui-events-x11/src/touch.rs
Comment thread ui-events-x11/src/pointer.rs
Comment thread ui-events-x11/src/keyboard.rs Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread ui-events-x11/src/pointer.rs Outdated
Comment thread ui-events-x11/src/tap.rs Outdated
Comment thread ui-events-x11/src/mapping.rs Outdated
Comment thread ui-events-x11/src/mapping.rs
@xorgy

xorgy commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, I'll address all of these tomorrow. I think some of them are red herrings, but I'll see when I look. :+ )

@xorgy
xorgy force-pushed the x11-adapter branch 4 times, most recently from e00c573 to a8f559a Compare July 22, 2026 17:25
@xorgy

xorgy commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Alright, I've addressed your review, and plan to follow up with an XIM related PR separate from this. XIM and complex compose require a bit of care to get right. As for adding an actual X harness, I can look into it, but if possible I'd like to defer that work a bit (and there's something to be said also for sharing some of that with a Wayland integration harness, since Wayland's input model is largely based on XI 2.4).

@xorgy
xorgy requested a review from waywardmonkeys July 22, 2026 17:37
@xorgy
xorgy requested a review from no-materials July 25, 2026 18:35
@xorgy
xorgy force-pushed the x11-adapter branch 3 times, most recently from bcfa9f6 to 8d7c342 Compare July 30, 2026 03:07
Add `ui-events-x11`, an adapter bridging X11 input into the
`ui-events` model with host-clocked keyboard, pointer, and touch
reducers.
It assumes XInput 2 and XKB, with no legacy core fallbacks.

Factor the XKB keysym and keymap code out of `ui-events-wayland` into
a shared `ui-events-xkb` crate, used by both adapters.

Since the `xkb` feature links `libxkbcommon`, restrict all-features CI
for these crates to the Linux runners that install it.
@xorgy
xorgy merged commit 3934f66 into forest-rs:main Aug 21, 2026
20 checks passed
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.

2 participants