Repository navigation
fix: EIS device lifecycle, keyboard burst, screen auto-detect (port from 01SW) - #15
Merged
Merged
Conversation
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
Port of three quality fixes from 01SW/kwin-mcp (independent fork of the same upstream; their code validated against KWin 6.7 EIS quirks we also observe), re-implemented on our codebase (official MCP SDK 2.x, async tools, lazy libei, ToolError contract):
_handle_eventdispatcher (RESUMED/PAUSED/ADDED/REMOVED/SEAT_REMOVED/DISCONNECT),_ensure_devices_readybefore every injection (wait emulating → reconnect via freshconnectToEISon stall),_connection_deadunified error path (DISCONNECT event,ei_dispatch() < 0), device-slot replace-semantics that don't steal handles from live devices, idempotent RESUMED, partial-handshake teardown, active-touch cleanup on reconnect. Adopted from 01SW with our hardening (text-device included in all lifecycle paths, ToolError contract, teardown).session_start(screen_width=0)= match the visible/logical desktop: kscreen-doctor (ANSI-stripped, Output-block parsing, enabled-only, priority-1 preferred) → xrandr (primary beatsScreen currentregardless of line order) → 1920×1080 fallback. Explicit sizes keep priority (non-breaking for callers passing sizes; BREAKING for default-relying clients, marked in CHANGELOG).Plus:
serverInfo.versionfrom package metadata (was empty),KWIN_MCP_DEBUG_EI=1debug logging via stdlib logging (documented in README), CHANGELOG entries with attribution.Verification loop
fixer → verifier → fixer → verifier (all 16 findings from two review rounds closed):
session_start(0,0)→ screenshot 1746×982 = actual desktop (auto-detect works, was dead before),session_start(800,600)→ 800×600, combo storm recovers via reconnect and delivers.Known follow-ups (non-blocking, separate issues)
mouse_click(they still go singlekeyboard_key).touch_move/upfetch the touch pointer before_ensure_devices_ready— narrow race vs reconnect; swap to ensure-first.