microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.85k stars 8.21k forks source link

Exclude Quake window from FancyZones #10197

Open xwillq opened 3 years ago

xwillq commented 3 years ago

Description of the new feature/enhancement

When I summon quake window while using FancyZones it snaps to the same zone where main terminal window is located.

Started fresh terminal instance:

image

Summoned quake window:

image

To solve this problem I can exclude WindowsTerminal.exe from FancyZones, but this way I won't be able to manage regular terminal windows with FancyZones. It would be better if we could exclude only the quake window, but not the other ones.

Proposed technical implementation details

As I understand, FancyZones uses application executable name for its Exclude rules (might be wrong, tho), thus it could be possible to create a separate executable for quake window, so we could exclude only this one. It's a dirty fix, but it can do the job if there is no other option.

zadjii-msft commented 3 years ago

Technically, any terminal window can become the quake window, so it's not going to be a good enough solution to have a different exe for the quake window.

@crutkas any clever ideas here?

crutkas commented 3 years ago

can we set the window type to maybe like popup or something in quake mode? Pretty sure a WS_POPUP will ignore FZ and what we'll do for PT Run shortly.

crutkas commented 3 years ago

Actually, this may be really interesting to work around since i think they have window remembered

@enricogior may have some ideas

DHowett commented 3 years ago

@crutkas is this something we should move over to your repo? If it turns into a feature request for us to have a specific window style or something, we can bring it back . . . but it doesn't appear to be actionable right now.

crutkas commented 3 years ago

A quake mode terminal can even be window snapped currently. This adjustment should prevent this as well as having FZ snap.

This is work that would need to be done in Terminal. FZ shouldn't need to be customized per-app if at all possible.

zadjii-msft commented 3 years ago

Okay, sounds like the recommendation is to add WS_POPUP whenever the Terminal is in quake mode. I'm a little worried that does something else to our window style that I don't know about quite yet. We'll need to make sure to test both the IslandWindow and the NonClientIslandWindow with that style to what changes.

zadjii-msft commented 2 years ago

Closed in https://github.com/MicrosoftDocs/terminal/pull/454

neur1n commented 2 years ago

Closed in MicrosoftDocs/terminal#454

I'm using PowerToys 0.57.2 and Windows Terminal Preview 1.13.10.733.0 and this issue still presents.

KalleOlaviNiemitalo commented 2 years ago

https://github.com/MicrosoftDocs/terminal/pull/454 says it closes https://github.com/microsoft/terminal/issues/10845. The doc change does not even mention FancyZones. It seems @zadjii-msft mistakenly closed this https://github.com/microsoft/terminal/issues/10197 instead, and left https://github.com/microsoft/terminal/issues/10845 open.

zadjii-msft commented 2 years ago

Wow yea what the heck was I thinking.

neur1n commented 2 years ago

I'm using PowerToys 0.57.2 and Windows Terminal Preview 1.13.10.733.0 and this issue still presents.

But a few moments later, the quake mode terminal got out from the zone when I pressed Win+`. Seems like it quakes in and out. The AUTHENTIC quake mode.

zadjii-msft commented 1 year ago

@LGUG2Z was asking me about this on mastodon and I think this might be a viable solution for https://github.com/LGUG2Z/komorebi too, but I haven't had any chance to investigate what the side effects of WS_POPUP would be

KalleOlaviNiemitalo commented 1 year ago

FancyZonesWindowUtils::IsCandidateForZoning checks WS_POPUP (via FancyZonesWindowUtils::IsPopupWindow), and other things.

In X11, applications set window properties on their windows to communicate their preferences to the window manager. Perhaps a similar scheme would work here for letting applications explicitly opt in or out of FancyZones, if WS_POPUP can have undesired effects. Windows appears to have two ways to associate properties with a window:

LGUG2Z commented 1 year ago

I'm not sure about FancyZones, but for the purposes of komorebi (and probably GlazeWM as well), even having a cloned class with a slightly different name applied to the Quake window, or setting the title of whichever window is chosen for Quake mode to something like "Terminal (Quake Mode)" would be more than enough for users to isolate it so that it isn't tiled as a regular window.