microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.27k stars 674 forks source link

Proposal: Have WinUI Desktop support the UWP Jumplist API #2005

Open Felix-Dev opened 4 years ago

Felix-Dev commented 4 years ago

Copied from the WinUI February Community Call thread to be used for tracking.

Currently, MSIX packaged desktop apps cannot effectively use the UWP Jumplist API because the app cannot be activated via jumplist tasks (see Windows Terminal issue https://github.com/microsoft/terminal/issues/576 for a brief overview of the problem). Full support of this API for WinUI Desktop apps would be quite nice as they are much easier to work with than the Win32/WPF APIs. For example, jumplist task icons can be easily set using the ms-appx:/// or ms-appdata:/// URI schemes instead of having to create an .exe or .dll containing the images, then set the path to that file and also an offset into the file for the specific icon.

The docs summarize the advantages of the UWP Jumplist API:

Alternatively, use the UWP Windows.UI.StartScreen.JumpList APIs instead, which allow you to reference string and image assets using the package-relative ms-resource URI scheme (which is also language, DPI, and high contrast aware).

ranjeshj commented 4 years ago

@jesbis Can you please route this ? It looks like it might be part of the shell.

Felix-Dev commented 4 years ago

@jesbis This seems like a good fit for Project Reunion. Should we transfer this issue (and update it to include all Win32 apps)?

mdtauk commented 4 years ago

Taskbar APIs like badging and preview buttons - as well as Context Menus etc - should be wrapped so Fluent WinUI controls can replace Win32 controls one at a time.

grork commented 4 years ago

Surely they should be separate from any UI stack? E.g. They’re a service of the shell, not the app platform.

Felix-Dev commented 4 years ago

This issue should be moved to Project Reunion (and extended to cover all Win32 apps and not just WinUI Desktop apps). Pinging @stevewri as they assigned themself to another UWP Jumplist API request.

mattleibow commented 3 years ago

I am having a look at getting Xamarin.Essentials / Microsoft MAUI running on WinUI and I notice that although the JumpList items are set, they do not have the args that I set when it launches the instance of the app. When the next instance of the app is launched, the JumpList still has the items with my args set. Just the OnLaunched event args do not have it.

When I added breakpoint in the generated static void Main(string[] args), I actually did get the args there. I also notice that it never does anything with it. I can also see it on Environment.GetCommandLineArgs() and Environment.CommandLine.

mattleibow commented 3 years ago

I added a hacky thing for my stuff:

            var args = e?.Arguments;
#if !WINDOWS_UWP
            if (string.IsNullOrEmpty(args))
            {
                var cliArgs = Environment.GetCommandLineArgs();
                if (cliArgs?.Length > 1)
                    args = cliArgs[1];
            }
#endif