unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.64k stars 699 forks source link

[skia][wpf] The full screen window is unstable #16970

Open lindexi opened 1 month ago

lindexi commented 1 month ago

Current behavior

Probabilistically, the taskbar will appear above the window and some users may see that the window does not fully cover the screen.

Expected behavior

The full screen window can keep the full screen mode.

How to reproduce it (as minimally and precisely as possible)

  1. Create the uno project
  2. Adding window.AppWindow.GetApplicationView().TryEnterFullScreenMode();
  3. Run on WPF platform

And you may find the taskbar will appear above the window and some users may see that the window does not fully cover the screen.

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

Skia (WPF)

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

Why?

Because the WpfWindowWrapper.ApplyFullScreenPresenter just set the WindowStyle and WindowState which is not enough , see https://github.com/unoplatform/uno/blob/18022fd39718941d0118f92c9dd208904aae4469/src/Uno.UI.Runtime.Skia.Wpf/UI/Controls/WpfWindowWrapper.cs#L122-L139

This is not the wpf's issues, but win32's.

As I said in https://github.com/dotnet/wpf/issues/3626#issuecomment-898781276 , we should add the win32 hook to keep the wpf window in full screen mode and I provide the demo code in https://github.com/lindexi/lindexi_gd/tree/46e400d9d4601730c1f5c974ea568416453fe48d/KenafearcuweYemjecahee .

But we do not plan to add the new enter full screen API to wpf now, and I think we can add it to UNO manually.

For more, see my Chinese blog: WPF Stable full screen window solution

Reference: https://github.com/dotnet/wpf/issues/3627

ramezgerges commented 1 month ago

I can't reproduce this locally. I noticed another problem where going fullscreen -> exiting -> going fullscreen again was problematic (fix pending in https://github.com/unoplatform/uno/pull/16994), but other than that, the uno window never gets overlapped by the taskbar.

lindexi commented 1 month ago

Thank you @ramezgerges . But it is not a easy reproduced issues. It is the wpf old known issues.