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

Add a minimizeToNotificationArea action #11229

Open
rashil2000 opened this issue Sep 15, 2021 · 9 comments
Open

Add a minimizeToNotificationArea action #11229

rashil2000 opened this issue Sep 15, 2021 · 9 comments
Labels
Area-Windowing Window frame, quake mode, tearout Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Milestone

Comments

@rashil2000
Copy link
Contributor

Description of the new feature/enhancement

When the minimizeToTray property is set to true, the window gets minimized to the tray on clicking the minimize button on top right. I feel this is not always a desirable response - people might want to minimize to taskbar (the normal behavior) or minimize to tray, separately. An action called minimizeToTray (and a way to set a keybinding for this) would work best - allowing for both behaviors according to what the users want.
This will also allow WT to behave similar to tmux's detach - where detaching and minimizing (to taskbar) are distinct behaviors.

Proposed technical implementation details (optional)

I was reading the discussion here at #10368 (comment) - was this action not implemented?

@rashil2000 rashil2000 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Sep 15, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 15, 2021
@rashil2000
Copy link
Contributor Author

I've been meaning to make a contribution to WT for a long time - so I wanted to ask - if this isn't already implemented/being worked on, would it make a good beginner's issue?

@zadjii-msft
Copy link
Member

Part of the reason why that action wasn't implemented during that PR is because we weren't totally sold on how it should all work. The only way it could work right now is if the user already has "alwaysShowTrayIcon": true. If that seems reasonable to you, then I don't think it'd be terribly difficult to implement.

However, trying to implement this action to work even with "alwaysShowTrayIcon": false would be a good amount harder. We'd need to track per-window if they wanted to be minimized to the tray Notification Area, and decide to display the tray Notification Area icon if at least one of them wanted to be in the tray Notification Area.

Also, the action should technically be named minimizeToNotificationArea, see #11219

@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Discussion Something that requires a team discussion before we can proceed Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Sep 15, 2021
@rashil2000 rashil2000 changed the title Add a minimizeToTray action Add a minimizeToNotificationArea action Sep 15, 2021
@rashil2000
Copy link
Contributor Author

Part of the reason why that action wasn't implemented during that PR is because we weren't totally sold on how it should all work. The only way it could work right now is if the user already has "alwaysShowTrayIcon": true. If that seems reasonable to you, then I don't think it'd be terribly difficult to implement.

What would be the response if a user tries to invoke the minimizeToNotificationArea action when this setting is false?

@zadjii-msft
Copy link
Member

I can think of two things:

  • nothing at all
  • the terminal is minimized (but just like, normally minimized, to the taskbar)

@rashil2000
Copy link
Contributor Author

I feel doing nothing is better than doing something else.

On an unrelated note: pardon me for the stupid question, but what exactly happens when an app goes to the tray? Since the window is no longer visible, does it mean it is consuming less resources (which would have been used otherwise for drawing/painting the window and/or managing related memory/CPU time)? Of course the pwsh (or equivalent) process will continue to consume the same resource as before as it's still running in the background.

@zadjii-msft
Copy link
Member

but what exactly happens when an app goes to the tray

I'm pretty sure that nothing special happens. It's basically just the same as being in the taskbar, but with one less window snapshot to draw in alt+tab & win+tab. So I'd presume the difference is negligible.

@leonMSFT
Copy link
Contributor

leonMSFT commented Sep 15, 2021

Yeah I originally had the action implemented but left it out of the initial PR to stew on it a bit more. Then I got caught up in doing other things and forgot to put out a separate PR with this action 😅

IMO I like the idea of having the action work even with alwaysShowNotificationIcon:false, because if you're explicitly trying to minimizeToNotificationArea with an action, you know what you want, and there shouldn't be a global setting that you might not be aware of that's blocking your action. It should just do the thing and pop in a notification icon and the icon should just disappear when it's no longer in the notification area.

Though with that behavior, like @zadjii-msft said, it would require per-window tracking of minimized or not, making it more complicated to impl. If it's something you're interested in taking on though, by all means go for it!

@rashil2000
Copy link
Contributor Author

rashil2000 commented Sep 16, 2021

...and there shouldn't be a global setting that you might not be aware of that's blocking your action.

I was thinking about this too - because currently IIRC we don't have any actions that are dependent on a global setting.

Though with that behavior, like @zadjii-msft said, it would require per-window tracking of minimized or not, making it more complicated to impl. If it's something you're interested in taking on though, by all means go for it!

I'll be honest - I think it'll be too much for me 😅. I just know college-level C++ and have never worked on any project this large/complex.

I have one other (unrelated) feature request that might be easier to get me started (I'll open an issue sometime later today). Edit: Oops, I just saw that it has already been done - #11116

@zadjii-msft
Copy link
Member

Discussed with the team:

  • We think this is a fine idea
  • Ideally, performing this action would minimize to the tray regardless. If the tray icon isn't already visible (i.e. alwaysShowNotificationIcon is false), then it should show the icon.
  • We'd probably be willing to accept just the "just minimize if there isn't a tray icon yet" and work towards the ideal implementation incrementally
  • a90d2ec is probably the best place to start. You'd probably want to revert that commit, though, there's been a fair amount of churn in that area, so it might not be that simple.

@zadjii-msft zadjii-msft added Area-Windowing Window frame, quake mode, tearout Help Wanted We encourage anyone to jump in on these. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Discussion Something that requires a team discussion before we can proceed labels Sep 20, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Sep 20, 2021
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Windowing Window frame, quake mode, tearout Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants