Microsoft-ui-xaml: Resizing window with full client rect Xaml Island draws window background first

Created on 25 May 2019  ·  1Comment  ·  Source: microsoft/microsoft-ui-xaml

Describe the bug
When resizing the main window, the result of WM_ERASEBKGND is drawn before the Xaml Island.

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Set the Xaml Island HWND size to be the full client rect of main window as a result of WM_SIZE (or WM_SIZING)
  2. Resize the main window with the mouse
  3. Example available at https://github.com/MarkIngramUK/XamlIslands

Expected behavior
To not see the result of WM_ERASEBKGND (i.e. WndClassExW.hbrBackground) before the Xaml Island renders.

Screenshots
The red is from wc.hbrBackground = CreateSolidBrush(RGB(255, 0, 0));, the blue is from the Xaml Island root content.
Resize

Version Info
1903

NuGet package version:
N/A


| Windows 10 version | Saw the problem? |
| :--------------------------------- | :-------------------- |
| Insider Build (xxxxx) | |
| May 2019 Update (18362) | Yes |
| October 2018 Update (17763) | Yes |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) | |
| Anniversary Update (14393) | |


| Device form factor | Saw the problem? |
| :-------------------- | :------------------- |
| Desktop | Yes |
| Mobile | |
| Xbox | |
| Surface Hub | |
| IoT | |

Additional context
You can largely hide the issue by specifying WS_EX_NOREDIRECTIONBITMAP on the main window, but it would be good if the Xaml Island rendered on resize, as it would make the resize seem smoother.

area-Islands team-Reach

Most helpful comment

This is a known limitation of XAML Islands v1 that should be addressed in WinUI 3 Islands.

>All comments

This is a known limitation of XAML Islands v1 that should be addressed in WinUI 3 Islands.

Was this page helpful?
0 / 5 - 0 ratings