Skip to content

fix: Report held Alt and Windows modifiers on X11, Android and framebuffer - #25402

Merged
ramezgerges merged 3 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/keyboard-modifier-mappers
Oct 19, 2026
Merged

ramezgerges merged 3 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/keyboard-modifier-mappers

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25401

PR Type:

🐞 Bugfix

What changed? 🚀

Since #24575, the keyboard modifier state is resynced from each key event's KeyboardModifiers before dispatch. Three platform mappers leave out a modifier that is held, so the resync marks it released and CoreWindow.GetKeyState reads it as up while it is still down:

  • X11: Mod1Mask (Alt) was mapped to Shift. It now maps to Menu. A duplicate ControlMask check is removed.
  • Android: the meta state's Alt bits were never mapped. AltMask now maps to Menu.
  • Linux framebuffer: the Meta keys were never reported. They now map to Windows.

The tvOS keyboard source always reports None, which is correct: it only carries Siri Remote presses, and the remote has no modifier keys.

These mapper bugs predate #24575. Before it, a wrong modifier only affected that event's KeyModifiers; the resync now uses it to rewrite the tracked key state. A backport of this PR will go out together with #24575's backport to 6.8 (#25155).

Validation:

  • Runtime, X11 (WSLg): the KeyboardStateProbe sample, driven by real X events from xdotool: hold Alt, press F, release Alt.
    • master: menu=Down, then shift=Down menu=None once F is pressed while Alt is still held.
    • this PR: menu=Down until Alt is released, and Shift stays None.
  • Compile: Uno.UI.Runtime.X11, Uno.UI.Runtime.Linux.FrameBuffer and Uno.WinRT (net11.0-android).
  • Not validated at runtime: the Android and framebuffer changes.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable): validated with the existing KeyboardStateProbe sample. The mappers are internal to the platform runtimes, which the runtime tests don't reference.
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features): not applicable.
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

🤖 Generated with Claude Code

ramezgerges and others added 3 commits October 13, 2026 14:25
Mod1, the Alt modifier, was reported as Shift, so a key pressed with
Alt held carried Shift instead of Menu. Since the modifier state is
resynced from each key event's modifiers, holding Alt and pressing
another key marked Alt released and Shift held, and
CoreWindow.GetKeyState(Menu) read up for the rest of the press.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The meta state's Alt bits were never mapped, so key events carried no
Menu modifier and the modifier resync marked a held Alt released on
the next key.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Meta keys were never reported as the Windows modifier, so the
modifier resync marked a held Windows key released on the next key.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/x11 🐧 Categorizes an issue or PR as relevant to X11 labels Oct 13, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239277 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DropDownButtonPage.png-dark
    • Examples.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AuthenticationBroker_Demo.png-dark
    • Accessibility_ScreenReader.png-dark
    • AndroidWindowInsets.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AnimatedBackVisualSourceSamplePage.png
    • Accessibility_ScreenReader.png
    • AutoBorderStretchwithrightmargin.png
    • AppBarButtonTest.png
    • AnimatedIconPage.png
    • AppBarToggleButtonTest.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AppBarButtonWithIconTest.png
    • AutomationProperties_Relations.png-dark
    • AppBar_KeyBoard.png
    • AppBarButtonWithIconTest.png-dark
    • ApplicationViewSizing.png-dark
    • ApplicationViewMode.png-dark
    • ApplicationViewMode.png
    • AutoSizedTopLeft.png-dark
    • ApplicationViewSpanningRectsPage.png-dark

@ramezgerges

Copy link
Copy Markdown
Contributor Author

/azp run Uno.UI - CI

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239688 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • Examples.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppBarButtonWithIconTest.png-dark
    • AppBar_KeyBoard.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowClosing.png
    • AppWindowTitleBar Properties.png-dark
    • ArcSegment.png
    • Attributed_text_Supserscript.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutoBorderStretchwithrightmargin.png
    • AutomationProperties_Relations.png
    • AutomationProperties_StructureAndProps.png-dark
    • BackGesture.png-dark
    • BackGesture.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
    • Battery.png-dark
    • Battery.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png

@ramezgerges
ramezgerges enabled auto-merge October 19, 2026 14:01
@ramezgerges
ramezgerges disabled auto-merge October 19, 2026 14:19
@ramezgerges
ramezgerges merged commit 73cdcf3 into unoplatform:master Oct 19, 2026
46 checks passed
@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport servicing/6.8 release/stable/6.7

@mergify

mergify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8 release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Nov 2, 2026
…6.7/pr-25402

fix: Report held Alt and Windows modifiers on X11, Android and framebuffer (backport #25402)
agneszitte added a commit that referenced this pull request Nov 2, 2026
…r-25402

fix: Report held Alt and Windows modifiers on X11, Android and framebuffer (backport #25402)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/x11 🐧 Categorizes an issue or PR as relevant to X11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Held Alt and Windows modifiers read as released on X11, Android and framebuffer

5 participants