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

[Bug] Popup with disabled IsLightDismissEnabled works as Topmost #4630

Open
maxkatz6 opened this issue Sep 8, 2020 · 4 comments
Open

[Bug] Popup with disabled IsLightDismissEnabled works as Topmost #4630

maxkatz6 opened this issue Sep 8, 2020 · 4 comments

Comments

@maxkatz6
Copy link
Member

maxkatz6 commented Sep 8, 2020

Actual result:

When window is minimized, popup with StaysOpen enabled (or IsLightDismissEnabled = false in preview) keeps opened on top of another applications.
In other words, it works just like Topmost = true on Windows.

Expected result:

Popup is hidden with minimized window.
When window is opened back from minimized state, popup should be visible back (as it should with StaysOpen=true).
If window loses focus, popup shouldn't be on top of another windows (when Topmost=false, as it is by default).

Gif

gif2

Repro

AvaloniaApplication3.zip

@maxkatz6
Copy link
Member Author

maxkatz6 commented Sep 8, 2020

Workarounds:

  1. Set StaysOpen to false (if it's fine for application logic).
  2. Set OverlayPopups = true in Win32PlatformOptions:
public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .With(new Win32PlatformOptions { OverlayPopups = true })
        .With(new AvaloniaNativePlatformOptions() { OverlayPopups = true }) ;

@maxkatz6
Copy link
Member Author

maxkatz6 commented Sep 8, 2020

Hm, found same issue - #4227
And similar another - #4225

@maxkatz6
Copy link
Member Author

Apparently, the same bug can be reproduced on MacOS.
Workround similar:

.With(new AvaloniaNativePlatformOptions() { OverlayPopups = true })

@maxkatz6 maxkatz6 changed the title [Bug] [Windows] Popup with disabled IsLightDismissEnabled works as Topmost [Bug] Popup with disabled IsLightDismissEnabled works as Topmost Mar 20, 2021
@GStefanowich
Copy link

Came across this issue and adding to this

AppBuilder.Configure<App>()
    .UsePlatformDetect()
    // Windows
    .With(new Win32PlatformOptions { OverlayPopups = true })
    // Unix/Linux
    .With(new X11PlatformOptions { OverlayPopups = true })
    // Mac?
    .With(new AvaloniaNativePlatformOptions { OverlayPopups = true })

Adding X11PlatformOptions fixed this issue for me on Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants