-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
wpf: add support for VT mouse mode #5375
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat
We can add XAML controls here for it if you really wanted to. https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands#wpf-and-windows-forms-applications At some point, we probably should start hosting XAML in WPF. |
@WSLUser yep, it’s a good idea! Right now our main consumer for the WPF control is Visual Studio, who can’t use the Islands or WinRT activation machinery UWP XAML requires on all the versions of the OS they run on (like, Windows 7 through 10.0.17763). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, contingent on @ZoeyR's approval.
@@ -27,6 +35,14 @@ LRESULT CALLBACK HwndTerminal::HwndTerminalWndProc( | |||
|
|||
if (terminal) | |||
{ | |||
if (_IsMouseMessage(uMsg) && terminal->_CanSendVTMouseInput()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really wish we could use _IsMouseMessage
in the case statements, I don't like this being separate. But I also wouldn't want to see that large list of message types in the switch 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't like this being separate
I agree totally with all these points. Conhost has them all as case labels, and it's monstrous. I may come through afterwards and refactor this code for flow/order, so we shall get a chance to revisit 😄
Hello @DHowett-MSFT! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
This pull request ports the VT mouse code from TermControl to WpfTerminalControl. Our WPF control is a lot closer to Win32 than to Xaml, so our mouse event handler looks nothing like the one that we got from Xaml. We can pass events through almost directly, because the window message handling in the mouse input code actually came from conhost. It's awesome.
Neither TermControl nor conhost pass hover events through when the control isn't focused, so I wired up focus events to make sure we acted the same.
Just like Terminal and conhost, mouse events are suppressed when Shift is held.
Validation Steps Performed
Tested with MC, and tested by manually engaging SGR events in an Echo terminal.