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

Exempt the _quake window from glomming #9956

Merged
1 commit merged into from
Apr 28, 2021

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Apr 26, 2021

Summary of the Pull Request

We don't want it acting as the "most recent window" for windowing behavior.
The most recent window should always be some other window.

This is being made as an atomic commit because we're probably 50% sure on this
one. Maybe people do want new tabs to open up in the quake window! If they're
running from the commandline, that's easy. If they're running from the shell
context menu, that's Hard / impossible currently. $20 someone asks for
that if we ship this. That of course might just fall into "explorer context
menu settings" though.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

I mean, this one's super straightforward, not sure what else there is to add.

Validation Steps Performed

Played with this, it works exactly as you'd think.

@zadjii-msft zadjii-msft added this to the Terminal v1.9 milestone Apr 26, 2021
@zadjii-msft zadjii-msft changed the base branch from dev/migrie/f/653-special-_quake-window to main April 26, 2021 19:36
@@ -285,12 +285,21 @@ namespace winrt::TerminalApp::implementation
// launched _fullscreen_, toggle fullscreen mode. This will make sure
// that the window size is _first_ set up as something sensible, so
// leaving fullscreen returns to a reasonable size.
//
// We know at the start, that the root TerminalPage definitely isn't
Copy link
Member

Choose a reason for hiding this comment

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

But why do we know that? Is it because we reset the focus mode when we hide the quake window?

Comment on lines 2072 to 2073
// If we're the quake window, we must always be in focus mode.
// Prevent leaving focus mode here.
Copy link
Member

Choose a reason for hiding this comment

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

I know we're on a tight budget and I'd be happy to approve this PR regardless, but technically...

This doesn't strike me as the right kind of abstraction for me. It's like a... inverse leaky abstraction. Basically a leaky injection.
I'd suggest to keep TerminalPage unaware about what meaning a window name has, as such logic should be controlled centrally in a single place if possible. Instead a "DisableFocusModeChanges" property might be appropriate.

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.

I couldn't quite follow the AppHost::_HandleCreateWindow diff. I'll review at a later time again, but it looks good so far (just a few comments).

src/cascadia/WindowsTerminal/AppHost.cpp Outdated Show resolved Hide resolved
src/cascadia/WindowsTerminal/AppHost.cpp Outdated Show resolved Hide resolved
src/cascadia/WindowsTerminal/IslandWindow.cpp Outdated Show resolved Hide resolved
@zadjii-msft
Copy link
Member Author

Ooof what the heck happened to this diff - it should only be a oneline diff for 35b964d. I'll rebase it. Sorry for the confusion @lhecker 😐

  We don't want it acting as the "most recent window" for windowing behavior.
  The most recent window should always be some other window.

  This is being made as an atomic commit because we're probably 50% sure on this
  one. Maybe people do want new tabs to open up in the quake window! If they're
  running from the commandline, that's easy. If they're running from the shell
  context menu, that's **H**ard / impossible currently. $20 someone asks for
  that if we ship this. That of course might just fall into "explorer context
  menu settings" though.
@zadjii-msft zadjii-msft force-pushed the dev/migrie/f/excempt-_quake-from-glomming branch from 35b964d to c31d1b6 Compare April 27, 2021 10:25
@zadjii-msft
Copy link
Member Author

Okay, that's better now.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

It's a hack, but I'm OK with it.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Apr 28, 2021
@ghost
Copy link

ghost commented Apr 28, 2021

Hello @zadjii-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 7c439ba into main Apr 28, 2021
@ghost ghost deleted the dev/migrie/f/excempt-_quake-from-glomming branch April 28, 2021 10:37
DHowett pushed a commit that referenced this pull request May 19, 2021
## Summary of the Pull Request

This fixes a bug where if you had the `_quake` window open, and you tried to `globalSummon` it (not with the `quakeMode` action, but just with a plain-old `globalSummon` to activate the MRU window), we'd _create a new window_ instead of just summoning the `_quake` window.

## References
* regressed in #9956 

## PR Checklist
* [x] Closes https://github.com/microsoft/terminal/projects/5#card-60325142
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

It's basically a one-line fix, I just had to update the function signature for `_getMostRecentPeasantID` to allow us to use it differently for glomming vs summoning. When glomming, `ignoreQuakeWindow` should be true. When summoning, `ignoreQuakeWindow` should be false.
@ghost
Copy link

ghost commented May 25, 2021

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

Handy links:

@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:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants