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

MacOS rendered is not started when window state is restored from minimized programmatically #6399

Closed
maxkatz6 opened this issue Aug 10, 2021 · 1 comment · Fixed by #6407
Closed

Comments

@maxkatz6
Copy link
Member

Describe the bug
If window state was changed from Minimize to Normal (or any other) from the code, renderer won't be restarted.

To Reproduce
Steps to reproduce the behavior:

  1. Minimize window
  2. Setup timer to normalize window after 3 seconds
  3. ...
  4. Renderer is still stopped

Archive.zip

Desktop (please complete the following information):

  • OS: Mac
  • Version 0.10.6 and latest master
@maxkatz6
Copy link
Member Author

Workaround:

static MainWindow()
{
    Window.WindowStateProperty.Changed.Subscribe(WindowStatePropertyChanged);
}

public static void WindowStatePropertyChanged(AvaloniaPropertyChangedEventArgs<WindowState> args)
{
    if (args.OldValue.GetValueOrDefault<WindowState>() == WindowState.Minimized)
    {
        ((Window)args.Sender).Renderer.Start();
    }
}

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.

1 participant