Recommended way to resize and show/hide a WinUI 3 window? #10896
Unanswered
gautambjain
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
I don't know about the white area bug, but usually you can just use APIs on |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have recently reported an issue related to blank white window issue or partly blank window on this link: #10890 .
So I was wondering if there is a recommended way to resize and show/hide a WinUI 3 window.
I am using ::SetWindowPos api and ::ShowWindow api to actually show and resize the WinUI Window (Microsoft.UI.Xaml.Window). I resize when the window is hidden using ::SetWindowPos and then show the window using ::ShowWindow. Because my app shows a compact view too where I hide the MenuBar and CommandBar and make the window size smaller.
Is this the right method to resize and show WinUI window? Or I shouldn't be using the Win32 apis directly? Could the cause of the white patches be this? May be the recommended way to resize and show WinUI window is different?
Here are the screenshots of the issue. Once the blank window is shown, I am able to resize it. So user interaction is possible. But it doesn't draw anything. If I lock Windows using Win+L and unlock it then part of the window is drawn and I am able to click and use the part that is drawn and visible. So the UI thread is not hanging.
This issue is happening on about 20% of the customers PCs. And happens randomly. Like 2-3 times every day. Unfortunately, we are not able reproduce it on our own PCs. So finding it hard to fix it.
Beta Was this translation helpful? Give feedback.
All reactions