Merged
Conversation
This was referenced Feb 2, 2026
This was referenced Feb 9, 2026
This was referenced Feb 18, 2026
This was referenced Feb 25, 2026
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.
Issue 1013 - Linux floating ToolWindow blocks TextBox focus
Context
Issue reported on January 31, 2026 for Linux (KDE, Wayland). Windows and macOS do not reproduce.
Reproduction (Linux)
Investigation summary
ToolChromeControluses different drag behavior per OS.HostWindowso drag starts only from the chrome grip.WindowDragHelperattached to the entireHostWindow(full window).WindowDragHelperhandlesPointerPressedin the tunnel phase and setse.Handled = truefor any non-button control.Avalonia check
BeginMoveDragin Avalonia (for exampleAvalonia/src/Avalonia.Native/WindowImpl.cs) forwards to platform APIs and does not alter focus handling. The focus loss is caused by Dock's Linux-specific drag helper placement, not Avalonia itself. The Linux-specific path exists to avoid inconsistent drag behavior when starting a move immediately on some Linux window managers.Root cause
Dock's Linux branch attaches
WindowDragHelperto theHostWindowand uses a permissivecanStartDragfilter (only excludes buttons). This causes pointer presses on input controls (TextBox, etc.) to be handled as drag starts, blocking focus.Fix applied
Keep the Linux full-window drag helper but prevent it from stealing focus:
PointerPressedas handled until a drag is actually initiated (after the threshold).The helper now checks for focusable ancestors and only handles the pointer once a drag begins.
Files changed
src/Dock.Avalonia/Controls/ToolChromeControl.axaml.cssrc/Dock.Avalonia/Internal/WindowDragHelper.csAlternative workarounds (if needed)
A) Restrict drag to the tool chrome grip (title bar only)
Attach the drag helper to
PART_Gripinstead of the fullHostWindow. This matches the Windows/macOS behavior and fully avoids input interception.B) Exclude focusable controls (broader allowlist/denylist)
Keep full-window drag but expand
canStartDragto reject focusable controls and/or specific input types (TextBox, ComboBox, DatePicker, etc.). This avoids focus loss while keeping drag-anywhere.C) Don’t handle
PointerPresseduntil drag startsLet pointer presses flow through to controls; only mark
Handledwhen the drag threshold is exceeded and a drag begins.// Only set Handled once BeginMoveDrag is called.D) Linux-only hybrid (current fix)
Combine A/B/C just for Linux: keep full-window drag, ignore focusable elements, and delay handling until drag begins. This preserves Linux drag-anywhere while preventing focus loss.
E) Use system chrome on Linux
Disable custom chrome for tool windows on Linux by leaving system decorations enabled.
Verification notes
Fixes #1013