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

Summon this window when it receives an inbound connection #10217

Merged
2 commits merged into from
May 27, 2021

Conversation

miniksa
Copy link
Member

@miniksa miniksa commented May 26, 2021

Summon the listening window when it receives an inbound connection

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • We cannot just send our window to foreground by simply calling user32 on the window handle. But fortunately, the remoting behavior already has a summon window function with a workaround for the Quake functionality.
  • This bubbles up an event from the TerminalApp's Page to the WindowsTerminal's Apphost so it can call the same window summoning behavior in IslandWindow as is triggered when the Monarch dictates this out of the Microsoft.Terminal.Remoting project.

Validation Steps Performed

  • Opened the Terminal with it registered as DefTerm. Activated some other windows to the foreground. Start > Run > Cmd. Tab connects and opens in existing Terminal and it is brought to foreground.
  • With no running Terminal and registered as DefTerm, do Start > Run > Cmd. New Terminal is spawned and it is brought to foreground

@miniksa miniksa self-assigned this May 26, 2021
@ghost ghost added Area-DefApp Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels May 26, 2021
@miniksa
Copy link
Member Author

miniksa commented May 26, 2021

Note:

  • I would have loved to just hooked up TerminalApp/Page directly to the existing _HandleSummon function, but it takes an argument struct defined in the Remoting project.... which TerminalApp knows nothing about.
  • I also thought that inverting this completely and having Remoting accept the inbound connections (instead of TerminalApp) would fix my issue where I'm not routing them on preference at the moment AND let me use the Remoting structures... except the Remoting project doesn't know anything about TerminalConnections yet. WindowsTerminal project does.... but that's a lot more shake up of the code than this.
  • The advantage to this rather minimal change is that we could probably servicing consider this to Preview 1.9

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

Personally I'd abstract away the summoning call between _DispatchCommandline and _SummonWindowRequested.

@miniksa miniksa added the zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. label May 26, 2021
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.

That's exactly how I'd do it

@miniksa miniksa added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 27, 2021
@ghost
Copy link

ghost commented May 27, 2021

Hello @miniksa!

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 e694f36 into main May 27, 2021
@ghost ghost deleted the dev/miniksa/def_summon branch May 27, 2021 17:14
DHowett pushed a commit that referenced this pull request Jun 1, 2021
Summon the listening window when it receives an inbound connection

## PR Checklist
* [x] Closes #9460
* [x] I work here.
* [x] Manual test.

## Detailed Description of the Pull Request / Additional comments
- We cannot just send our window to foreground by simply calling user32 on the window handle. But fortunately, the remoting behavior already has a summon window function with a workaround for the Quake functionality.
- This bubbles up an event from the TerminalApp's Page to the WindowsTerminal's Apphost so it can call the same window summoning behavior in IslandWindow as is triggered when the Monarch dictates this out of the Microsoft.Terminal.Remoting project.

## Validation Steps Performed
- Opened the Terminal with it registered as DefTerm. Activated some other windows to the foreground. Start > Run > Cmd. Tab connects and opens in existing Terminal and it is brought to foreground.
- With no running Terminal and registered as DefTerm, do Start > Run > Cmd. New Terminal is spawned and it is brought to foreground

(cherry picked from commit e694f36)
@DHowett DHowett removed the zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. label Jul 7, 2021
@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal v1.9.1942.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal Preview v1.10.1933.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-DefApp Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DefApp] Activate receiving window on inbound connection
4 participants