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

wpf: port selection changes from TermControl, add multi-click selection #5374

Merged
4 commits merged into from
Apr 17, 2020

Conversation

DHowett-MSFT
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT commented Apr 16, 2020

Summary of the Pull Request

This pull request ports #5096 to WpfTerminalControl, bringing it in line with the selection mechanics in Terminal. It also introduces double- and triple-click selection and makes sure we clear the selection when we resize.

Please read #5096 for more details.

Detailed Description of the Pull Request / Additional comments

This code is, largely, copy-and-pasted from TermControl with some updates to use std::chrono and til::point. I love til::point. A lot.

Validation Steps Performed

Lots of manual selection.

@DHowett-MSFT DHowett-MSFT requested a review from ZoeyR April 16, 2020 05:24
@DHowett-MSFT
Copy link
Contributor Author

There's a lot of logic that could be shared between TC and WPF. That is not a discussion to be having before 1.0 😄

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this too

src/cascadia/PublicTerminalCore/HwndTerminal.cpp Outdated Show resolved Hide resolved
@zadjii-msft zadjii-msft added Area-Input Related to input processing (key presses, mouse, etc.) Area-WPFControl Things related to the WPF version of the TermControl labels Apr 16, 2020
Copy link
Member

@carlos-zamora carlos-zamora left a 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.

const auto delta{ timestamp - _lastMouseClickTimestamp };
if (point != _lastMouseClickPos || delta > _multiClickTime)
{
// exit early. This is a single click.
Copy link
Member

@carlos-zamora carlos-zamora Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// exit early. This is a single click.
// This is a single click.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment copied from TermControl; i may keep it.

Copy link
Contributor

@ZoeyR ZoeyR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, assuming std::chrono works on win7 (I assume it does)

@DHowett-MSFT
Copy link
Contributor Author

@ZoeyR so I was thinking about this. It looks like it uses QueryPerformanceCounter 😄

@DHowett-MSFT
Copy link
Contributor Author

(which does exist on w7, so.. fingers crossed)

@DHowett-MSFT DHowett-MSFT added the AutoMerge Marked for automatic merge by the bot when requirements are met label Apr 17, 2020
@ghost
Copy link

ghost commented Apr 17, 2020

Hello @DHowett-MSFT!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit a6b2e7f into master Apr 17, 2020
@ghost ghost deleted the dev/duhowett/wpf_selection_fixes branch April 17, 2020 01:10
@ghost
Copy link

ghost commented Apr 22, 2020

🎉Windows Terminal Preview v0.11.1121.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-WPFControl Things related to the WPF version of the TermControl AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants