Skip to content

AppInstance redirection APIs don't transfer foreground rights #1439

@andrewleader

Description

@andrewleader

Describe the bug

I'm trying to use AppLifecycle.AppInstance redirection APIs to redirect to a single instance (and then bring that instance to the foreground), however it seems the foreground rights aren't being passed to the main instance when using RedirectActivationTo().

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create a WinUI 3 desktop app using 1.0 Preview 1 and add AppInstance with single-instance redirection
    1. Call GetCurrent().GetActivatedEventArgs() first
    2. Then call FindOrRegisterForKey("main")
    3. If that main instance is current, register the Activated event
    4. Otherwise, call main.RedirectActivationToAsync(args)
  2. Within the Activated event, attempt to bring the window to the foreground
    1. Get the DispatcherQueue to enter the UI thread
    2. Then call the Activate() method on your window
    3. Expected: Window comes to foreground
    4. Actual: Nothing happens

Version Info

NuGet package version:

Microsoft.WindowsAppSDK 1.0.0-preview1

Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)

Additional context

Metadata

Metadata

Assignees

Labels

area-LifecycleTopics related to the AppLifecycle, providing lifecycle management for WindowsAppSDK appsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions