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

Display current tab's icon as a badge on the taskbar icon #1871

Open
dave-c-whitney opened this issue Jul 8, 2019 · 20 comments
Open

Display current tab's icon as a badge on the taskbar icon #1871

dave-c-whitney opened this issue Jul 8, 2019 · 20 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@dave-c-whitney
Copy link

dave-c-whitney commented Jul 8, 2019

I can assign individual icons for each profile, and each tab I open for said profile has that profile's icon on the tab. HOWEVER, the taskbar "button" has the primary app icon on it, which isn't as helpful as having the currently active tab's icon instead. The correct icon provides a visual cue on which taskbar button is "my" button I'm looking for.

Proposed technical implementation details (optional)

@dave-c-whitney dave-c-whitney added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 8, 2019
@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 Jul 8, 2019
@zadjii-msft
Copy link
Member

Is it even possible to change the taskbar icon for an exe at runtime?

@dave-c-whitney
Copy link
Author

I believe the taskbar icon matches the window's icon, which you can change at runtime.

@fredless
Copy link

fredless commented Jul 8, 2019

Is it even possible to change the taskbar icon for an exe at runtime?

Outlook does, and I've seen other (non-UWP) apps do it to implement faux-badging too.

That being said, I prefer the current static icon approach.

@dave-c-whitney
Copy link
Author

I feel a configuration switch coming on...

@DHowett-MSFT
Copy link
Contributor

I'm inclined to just say "nah."

@DHowett-MSFT
Copy link
Contributor

I'm inclined to just say "this can actually be pretty useful" and stick it on the backlog. Thanks!

@DHowett-MSFT DHowett-MSFT added this to the Terminal Backlog milestone Jul 11, 2019
@DHowett-MSFT DHowett-MSFT added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 11, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 11, 2019
@DHowett-MSFT DHowett-MSFT added Help Wanted We encourage anyone to jump in on these. Needs-Tag-Fix Doesn't match tag requirements labels Jul 11, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 11, 2019
@cinnamon-msft
Copy link
Contributor

I had a little downtime today so I created these mockups 😊

image

@dave-c-whitney
Copy link
Author

How do they look downscaled to the size of the taskbar buttons? Are the adornments even visible any more?

@Summon528
Copy link
Contributor

This might not be possible
See: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/badges

You cannot provide your own badge image; only system-provided badge images can be used.

@oising
Copy link
Collaborator

oising commented Jul 16, 2019

I looked into this before and found some information that may be pertinent here:

When Windows Installer creates shortcuts in the Start menu, it sets the icon of the shortcuts which point to Installer cache of icons. This feature is required for advertising, where the referenced file does not exist but still the correct icon should be shown. It also allows showing the correct icon to the application if its main .exe is removed (and you can run MSI repair to fix it).

Your application is started with shortcut from Startup folder, and the icon of the shortcut is used on the Taskbar. (And you have the main window: no matter how you show it, when app starts or only when you click app icon in the notification area; moreover you have to have a window to be able to get clicks from notification area icon.)

When you disabled pinning your app to the Taskbar, it ignores the icon set in the shortcut that started your application, and therefore icon on Taskbar updates when you change the window icon.

Basically, you can't update the taskbar icon at runtime unless you've disabled pinning.

@dave-c-whitney
Copy link
Author

No big deal. I don't have much of anything pinned.

@dsafa
Copy link
Contributor

dsafa commented Jul 16, 2019

There does exist a win32 api for adding overlay icons to the taskbar button which could be used for this ITaskbarList3::SetOverlayIcon.

A quick demo on what it would actually look like:
HfIW5KqMt1
hr70CDNU4O

@oising
Copy link
Collaborator

oising commented Jul 17, 2019

@dsafa -- the API doesn't allow arbitrary overlays: There's a fixed list. We could emulate what you show by replacing the entire icon though, under certain conditions.

@dsafa
Copy link
Contributor

dsafa commented Jul 19, 2019

With the UWP badges I do see the restrictions. However, with the older desktop api it does appear to be able to support arbitrary icons. The screenshot is from a quick implementation using a hardcoded image.

@brucejo75
Copy link

brucejo75 commented Mar 1, 2020

Chiming in...

I think this option request is super useful. An alternative is to be able to set up icons for shortcuts that would display in the taskbar. Which currently doesn't work with wt.exe. But there is already a working example.

cmd.exe can use shortcut icons!

cmd.exe essentially has this feature. This should be able to be replicated by the Windows Terminal?

Create a shortcut1, target: C:\Windows\System32\cmd.exe
Add it's own icon. (Icon1)

Create a shortcut2 target: C:\Windows\System32\cmd.exe
Add it's own icon. (Icon2)

  1. Start shortcut1, Icon1 displays in the taskbar.
  2. Start shortcut2, Icon2 displays in the taskbar even though it is just a 2nd instance of cmd.exe.

Here is a screenshot:

CMD exe Icons

What you are looking at:
2 separate cmd.exe sessions on the left & 2 different bash.exe sessions on the right. Each with their own taskbar icon. Very easy to choose the right session from the taskbar.

Why is this useful?

My development involves at least the following environments:

  • Dev Machine with 2 different build environments. Each environment has a different set of environment variables. So each one gets their own session with icon.
  • Build machine that I SSH into. Another session with icon.
  • Deployed service machine(s) (livetest, staging, live) each session with icons.
  • MacOS machine for building iOS app builds (another icon)

Another complication: I tend to open 2-3 windows per environment when I am working on them.

So using Windows Terminal I could set up a SUPER session that had a tab for each environment and 2-3 panes per tab. Problem solved!

Except sometimes I need multiple environments visible on the screen at the same time and context switching between tabs can be a pain. So I set up a couple of shortcuts with a subset of environment tabs in each shortcut.

Or maybe an ideal is to set up each environment as a shortcut to a wt.exe session.

But figuring out which session belongs to which environment is a bear without a feature like this.

Added #4768 as a separate feature request.

@zadjii-msft zadjii-msft changed the title Taskbar icon should match current tab's icon Display current tab's icon as a badge on the taskbar icon Jun 18, 2020
@AnuthaDev
Copy link
Contributor

@zadjii-msft
Copy link
Member

zadjii-msft commented Jul 26, 2021

Note

Walkthrough

(not my best walkthrough, but a start)

Look at dev/migrie/f/4768-taskbar-icons for a start here. That's got code for making HICONs out of image files.

  • Add a global showTaskbarOverlay setting, that's a bool, to MTSMSettings.h
  • Plumb the profile icon path up from TerminalPage -> AppHost, whenever the active pane changes.
    • This should just be a PropertyChanged event, ala TitlebarBrush, FrameBrush.
    • What happens when the icon is a Web URL?
      • We probably just have to say that these won't work for now. I looked into BackgroundDownloader, but seemingly didn't work for packaged centennial apps.
    • What about ms-appx URIs?
  • Take the code from dev/migrie/f/4768-taskbar-icons, and move that into IconPathConverter somewhere. It needs a LOT of cleanup.
    • IconPathConverter is in terminal.settings.model. We need to use this up at the Window level, and that doesn't reference T.S.M.
    • _getIconIndex probably needs to get pulled out to a helper.
    • Don't do raw COM like that, use smart pointers.
    • Make sure that it works unpackaged.
    • Use smart pointers for the HICON et al.
    • Should we cache these HICON's in a map in the AppHost, so if we see the same URI again, we skip the generation? PROBABLY
  • ITaskbarList3::SetOverlayIcon to set the icon.

@vemundha

This comment has been minimized.

@zadjii-msft

This comment has been minimized.

@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
@zadjii-msft
Copy link
Member

xlink: #4768 (comment) has the most comprehensive summary of the problem space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
Status: Walkthrough in issue
Development

No branches or pull requests