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

Main Window flickers in incorrect location prior to rendering in v11.1.0-beta1 #15003

Closed
billhenn opened this issue Mar 15, 2024 · 3 comments · Fixed by #15035
Closed

Main Window flickers in incorrect location prior to rendering in v11.1.0-beta1 #15003

billhenn opened this issue Mar 15, 2024 · 3 comments · Fixed by #15035

Comments

@billhenn
Copy link
Contributor

Describe the bug

When a main Window is opened for an app, it can briefly show its titlebar and frame in a certain location, then it moves to another location and displays fully-rendered. This behavior was first observed in v11.1.0-beta1 and @grokys narrowed the change that caused it down to this PR.

To Reproduce

  • Follow steps here to download and open our sample solution: https://github.com/Actipro/Avalonia-Controls#download-and-run-samples
  • In the /Samples/SampleBrowser/References/Avalonia.References.props file, update AvaloniaVersion to 11.1.0-beta1.
  • Do a full solution rebuild.
  • Run the app and see if you notice the ghost window flicker before the main window shows properly.
  • Revert AvaloniaVersion back to 11.0.7 (or a later 11.0 build) and full rebuild solution and run again. You won't see the flicker.

Expected behavior

There should be no flicker when the main window is opened.

Avalonia version

11.1.0-beta1

OS

Windows

Additional context

This flicker was observed on latest Windows 11.

@grokys
Copy link
Member

grokys commented Mar 19, 2024

@TomEdwardsEnscape any idea how #14470 might have caused this, and what the fix might be?

@TomEdwardsEnscape
Copy link
Contributor

Looks like even though SetWindowPos will restore a minimised window, it will not show one that has not yet been shown. This means that a change in behaviour snuck in via #14470 when an unshown window is resized.

The problem is noticeable in the Actipro repo because their window takes a long time to open, then removes window decorations and centres itself on-screen. But it's replicable in any window if those conditions are replicated.

@billhenn
Copy link
Contributor Author

It looks like #15035 resolves the issue. Thanks!

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.

4 participants