-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Linux][MacOS] Rendering is stopped after system restores previously minimized and hidden window #18148
Comments
On Windows OS, task bar shows icons of each window, grouping them by app (which can also be disabled). When window is hidden - icon is also hidden. Which is excepted. On MacOS (and some linux distros), dock displays applications, and not individual windows. Furthermore, it's common for MacOS native apps to keep application icon on the dock as well as whole process running, even when there are no windows opened at all (in case of avalonia, it can be achieved by Linux behavior you described sounds like a
Close the window then. "Minimize to tray" essentially is just a tray icon defined without any window opened, while keeping process alive. |
I didn't test your code, but from looking at it, I wonder if renderer is failing to restart itself when minimized and then hidden window is shown by Linux OS. |
The empty content also happens on mac when you click the icon on the dock, it restores the main window by changing its state to whatever it was but the content is actually still hidden. Now, i dont really want to close the view, i would have to reload all data into the viewmodels, there is stuff that can still run in the background that will have to continue and restored into a new vm, like download and decompressing with progress tracking, etc. Also i found a crashing bug with the tray icon on linux, i will create a diferent issue for it. |
If you use mvvm, and keep your data in the view model, you don't really have to reload it, once it's there. Since it's separated from the window for a reason. |
Describe the bug
Calling .Hide() on the main window yields diferent results based on the OS. This happens when i .Hide() the main window after clicking minimize button on the window.
On Windows:
-Is completely hidden, dissapears from the taskbar as expected and can only bring back by code by calling .Show()
-By calling .Show() the app icon will be displayed on the taskbar again.
This is i assume the expected behaviour.
On Linux:
-By calling .Hide() the window is hidden but that taskbar icon is still there if i click it it will bring back the main window but the content is not show, as if it where IsVisible = false;
-Calling .Show() will restore the main window content.
Now, Windows behaviour can be achived on linux by also setting .ShowInTaskbar = false after calling .Hide(), and then set to to true after calling .Show().
On Mac:
-It has the same problems as in Linux but with the difference that "ShowInTaskbar" does nothing so it cant be fixed.
To Reproduce
in app.axlm.cs:
Then restore the window with .Show() some time later.
Expected behavior
Same results in Linux and MacOS as in Windows.
Avalonia version
11.2.3
OS
Windows, macOS, Linux
Additional context
Trying to create a "minimize to tray" function
The text was updated successfully, but these errors were encountered: