Repository navigation
Conversation
ztancrell
force-pushed
the
xi-swap-device-property-notify
branch
2 times, most recently
from
October 19, 2026 02:39
2205a1c to
a46a35d
Compare
XInputExtensionInit() registers SEventIDispatch in EventSwapVector for the other XI 1.x events, but not for DevicePropertyNotify, which keeps the NotImplemented default. SEventIDispatch already handles the event (SDevicePropertyNotifyEvent), and IResetProc already resets the slot. So when a byte-swapped client selects DevicePropertyNotifyMask and a device property changes, WriteEventsToClient() calls NotImplemented(), which calls FatalError() and takes the server down. Register SEventIDispatch for it like the others. Add a pyxtest regression test: a byte-swapped client selects DevicePropertyNotify via XSelectExtensionEvent, changes a device property, and must receive the event with its atom byte-swapped. On Xvfb the test fails without this change and passes with it. This patch was written with AI assistance (Claude Code, Claude Opus 4.8 and Claude Opus 5.5). I reviewed the change and ran the test before submitting. Signed-off-by: ztancrell <ztancrell@tutamail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ztancrell
force-pushed
the
xi-swap-device-property-notify
branch
from
October 29, 2026 16:20
a46a35d to
d38800b
Compare
metux
force-pushed
the
master
branch
4 times, most recently
from
October 30, 2026 11:57
eae2c21 to
483a172
Compare
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.
XInputExtensionInit()setsSEventIDispatchas the swap handler inEventSwapVectorfor the other XI 1.x events.DevicePropertyNotifywas missed, so its slot still holdsNotImplemented.SEventIDispatchalready handles this event (SDevicePropertyNotifyEvent), andIResetProc()already resets the slot.How it crashes: a byte-swapped client selects
DevicePropertyNotifyMask, then a device property changes.WriteEventsToClient()callsNotImplemented(), which callsFatalError("Not implemented")and kills the server for every session. Any opposite-endian client can trigger this.The fix is one line, registering
SEventIDispatchforDevicePropertyNotifylike the neighbouring events.Test: this PR adds a pyxtest regression test,
TestXIDevicePropertyNotifySwap, and anXSelectExtensionEventrequest builder inproto/xi.py. The test has a byte-swapped client selectDevicePropertyNotifyand change a property on the virtual core keyboard, then checks that the server is still alive.Results on Xvfb, built from current
master:test/pyxtest/with the fix: 37 passed, 26 skipped, 0 failed.AI disclosure: I wrote this patch with AI help (Claude Code, Claude Opus 4.8 and Claude Opus 5.5). The commit has
Co-Authored-Bylines for both models. I reviewed the change and ran the tests above myself before submitting.🤖 Generated with Claude Code