Skip to content

Glitched UI after restart / change of display adapters #10844

@tinodin

Description

@tinodin

Describe the bug

Whenever a new display adapter is added e.g. by installing a GPU driver or by disabling and enabling it through device manager, the UI becomes glitched (Text, Images, Backgrounds become invisible).
Most of it can be recovered by quickly dragging the window from the left side and back in a flicky way. Though some of the UI Elements stay glitched.

I have tried to rerender the xaml or programmatically resize the window but it doesn't fix it:

var content = MainWindow.Instance.Content;
MainWindow.Instance.Content = null;
MainWindow.Instance.Content = content;
((UIElement)content).UpdateLayout();
((UIElement)content).InvalidateArrange();
((UIElement)content).UpdateLayout();

Why is this important?

My app needs to be able to install / update GPU drivers or restart them without the UI becoming glitched. This is an essential part of my app.

Steps to reproduce the bug

  1. Open any WinUI3 application like the WinUI Gallery or Apple Music.
  2. Disable and Enable the current display adapter in device manager until the UI ends up glitched.
  3. Resize the window from the left side and see most of the UI getting fixed.

Actual behavior

The app opens and the UI is normal. After toggling the display adapter the app becomes glitched (Text, Images, Backgrounds become invisible). After resizing most of the UI is restored.

Expected behavior

The app opens and the UI is normal. After toggling the display adapter the app UI stays functional.

Screenshots

Image Image Image

NuGet package version

None

Windows version

Windows 11 (23H2): Build 22631

Additional context

This has been happening on every WinUI3 version I have used so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-CompInputIssue for IXP (Composition, Input) teamteam-ControlsIssue for the Controls team

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions