microsoft / microsoft/WindowsAppSDK

JumpList doesn't update when opening a registered file using FileOpenPicker

Open
#4,503 0 comments 1 reaction 0 assignees View on GitHub
UWP Gap
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

My app doesn't update the JumpList content (both in Start Menu and TaskBar) when opening a file using the FileOpenPicker. However, the Jump List is properly updated if I open the file (and my associated app) using a double click on the file icon.

### Steps to reproduce the bug

- Create a new app basen on Windows App SDK v1.5.4
- replace the original Click event of the default button with:

```
private async void myButton_Click(object sender, RoutedEventArgs e)
{
FileOpenPicker filePicker = new();
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
WinRT.Interop.InitializeWithWindow.Initialize(filePicker, hwnd);

filePicker.FileTypeFilter.Add(".lmest");
var file = await filePicker.PickSingleFileAsync();
}
```

> .lmest is my target extension

- Register the extension lmest in `Package.appxmanifest` as below:
![extension screenshot](https://github.com/microsoft/WindowsAppSDK/assets/7937648/25ead30c-ea35-4d47-976d-c8d884855b5c)

- Compile and launch the app and try to open a `.lmest` file, then check the jumplist

### Expected behavior

Expected JumpList:

![jumplist](https://github.com/microsoft/WindowsAppSDK/assets/7937648/56cf834b-2323-455b-af83-25487fadb63a)

populated with the file you have opened through FileOpenPicker

### Screenshots

_No response_

### NuGet package version

Windows App SDK 1.5.4: 1.5.240607001

### Packaging type

Packaged (MSIX)

### Windows version

Windows 10 version 22H2 (19045, 2022 Update)

### IDE

Visual Studio 2022

### Additional context

I have read the following resources to try to solve my question:
- [API FileOpenPicker](https://learn.microsoft.com/en-us/uwp/api/windows.storage.pickers.fileopenpicker?view=winrt-26100)
- [API JumpList](https://learn.microsoft.com/en-us/uwp/api/windows.ui.startscreen.jumplist?view=winrt-22621)
- [UWP Handle file Activation](https://learn.microsoft.com/en-us/windows/uwp/launch-resume/handle-file-activation)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Windows App SDK 1.5.4 reproduction using FileOpenPicker, the registered .lmest extension, and the packaged MSIX app on Windows 10 22H2. Compare opening the file through FileOpenPicker with opening it by double-clicking, and consult the linked FileOpenPicker, JumpList, and file-activation documentation. Done means the JumpList is populated consistently after the picker flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.