Skip to content

Use the control that requested the context menu, instead of the active one#15999

Merged
carlos-zamora merged 8 commits intomainfrom
dev/migrie/15760-addendum
Sep 20, 2023
Merged

Use the control that requested the context menu, instead of the active one#15999
carlos-zamora merged 8 commits intomainfrom
dev/migrie/15760-addendum

Conversation

@zadjii-msft
Copy link
Member

As mentioned in #15760

When you right-click on a non-active pane, it becomes active, but the context menu may be displayed before this happens, thus showing the Restart Connection item based the wrong pane's status.

As far as I can see, when a pane is (right)clicked:

  1. If unfocused, Focus is called. This goes through the GotFocus handler which eventually calls tab->_UpdateActivePane(sender);
  2. PointerPressed is raised which eventually shows the context menu

The first point is done asynchronously, so may update the active pane too late when the menu is already displayed (despite both end up in the UI thread).

To fix this: we plumb the control that the context menu was opened for all the way through to where the event is actually handled (in _PopulateContextMenu)

  • Tested manually

@carlos-zamora carlos-zamora merged commit 75f3d4f into main Sep 20, 2023
@carlos-zamora carlos-zamora deleted the dev/migrie/15760-addendum branch September 20, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants