Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
Sep 20, 2023

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
17 checks passed
@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