Fixes #5272. Ctrl+Click on link in Markdown no longer shows context menu#5283
Merged
YourRobotOverlord merged 1 commit intoMay 9, 2026
Conversation
…text menu Remove the base class Ctrl+LeftButtonReleased -> Command.Context mouse binding from Markdown.SetupBindingsAndCommands(). The base View registers this binding so Ctrl+Click can open a context menu, but the Markdown view already handles right-click directly in OnMouseEvent and uses Ctrl+Click for link following. Without this removal, Ctrl+Click would fire Command.Context -> ShowContextMenu() via the LeftButtonReleased event, showing the Select All/Copy popover at the upper-left corner (because no selection is active, GetContextMenuScreenPosition falls back to Point(0,0)). Add two regression tests: - MouseBindings_CtrlLeftButtonReleased_IsNotBoundTo_Context: verifies the binding is absent on a fresh Markdown instance - CtrlClick_On_Link_Opens_Link_And_Does_Not_Show_Context_Menu: end-to-end verification that Ctrl+Click fires LinkClicked without making the context menu visible Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced May 21, 2026
This was referenced May 28, 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.
Copilot Session
8584c489-d2b5-4dd6-bee4-a114a5d0665d
Summary
Fixes #5272.
When
Ctrl+Clickwas used to follow a link in aMarkdownview, the Select All/Copy context menu popover incorrectly appeared at the upper-left corner of the viewer (in addition to the link opening correctly).Root Cause
View.Mouse.csregisters a default binding:Markdown.SetupBindingsAndCommands()already removes theLeftButtonReleased → Activatebinding to prevent double-firing, but did not remove theLeftButtonReleased | Ctrl → Contextbinding. So during Ctrl+Click:LeftButtonReleased | Ctrl→Command.Context→ShowContextMenu()with no position → falls back toPoint(0,0)→ popover at upper-left ← bugLeftButtonClicked→OnActivated→ link opens correctlyFix
One line added in
SetupBindingsAndCommands():Right-click (handled in
OnMouseEvent) still shows the context menu as before.Tests
Two regression tests added to
MarkdownViewSelectionTests:MouseBindings_CtrlLeftButtonReleased_IsNotBoundTo_Context— binding-level checkCtrlClick_On_Link_Opens_Link_And_Does_Not_Show_Context_Menu— end-to-end check