Microsoft-ui-xaml: UWP [RANDOM BUG] rotation animation makes Background blink

Created on 10 Jan 2020  ·  5Comments  ·  Source: microsoft/microsoft-ui-xaml

_This issue has been moved from a ticket on Developer Community._


Hi, I want to share with you one of the controls, that was developed for one of my projects. This is animated pager control. It creates pages and automatically changes page with pretty rotation animation. Unfortunately, sometimes background color is missing just for a second, which results in strange blinks. In order to understand better the issue, I created a video for you.

In the first video I made the recording on Surface screen. Notice, that item 3-8 didn't have background just for a moment:

blink-3-8.mp4

This recording I've done on Samsung screen. Some items were missing background just for a second:

blink-11-12-another-screen.mp4

I also made a recording of how it looks like from user point:

20200103-154500.mp4

I created a minimal reproducible scenario for this issue. You can find repo here: https://github.com/aosyatnik/UWP_BackgroundBlinkIssue

I attach bin and obj folders as well. I hope they will help you to reproduce this issue.

bin-and-obj-folders.zip

I can say so far, that the issue is random but commonly reproducible. My customers could reproduce it on Dell laptops in release build as well. Blinks occurs at different places (I found ot, that it's connected with the size of the app window).

System info:

OS NameMicrosoft Windows 10 Pro Version10.0.18363 Build 18363 Other OS Description Not Available OS ManufacturerMicrosoft Corporation System NameDESKTOP-3KIJR4P System ManufacturerMicrosoft Corporation System ModelSurface Laptop System Typex64-based PC System SKUSurface_Laptop ProcessorIntel(R) Core(TM) i7-7660U CPU @ 2.50GHz, 2496 Mhz, 2 Core(s), 4 Logical Processor(s) BIOS Version/DateMicrosoft Corporation 137.2706.768, 4/18/2019 SMBIOS Version3.1 Embedded Controller Version255.255 BIOS ModeUEFI BaseBoard ManufacturerMicrosoft Corporation BaseBoard ProductSurface Laptop BaseBoard VersionNot Available Platform RoleMobile Secure Boot StateOn PCR7 ConfigurationElevation Required to View Windows DirectoryC:\WINDOWS System DirectoryC:\WINDOWS\system32 Boot Device\Device\HarddiskVolume1 LocaleRussia Hardware Abstraction LayerVersion = "10.0.18362.387" User NameAzureAD\HannaMelashkina Time ZoneRomance Standard Time Installed Physical Memory (RAM)16.0 GB Total Physical Memory15.9 GB Available Physical Memory3.12 GB Total Virtual Memory26.6 GB Available Virtual Memory4.38 GB Page File Space10.7 GB Page FileC:\pagefile.sys Kernel DMA ProtectionNot Available Virtualization-based securityRunning Virtualization-based security Required Security Properties Virtualization-based security Available Security PropertiesBase Virtualization Support, Secure Boot, DMA Protection, UEFI Code Readonly, SMM Security Mitigations 1.0, Mode Based Execution Control Virtualization-based security Services Configured Virtualization-based security Services Running Device Encryption SupportElevation Required to View A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Visual studio info:

Microsoft Visual Studio Enterprise 2019 (2) Version 16.3.10 VisualStudio.16.Release/16.3.10+29519.87 Microsoft .NET Framework Version 4.8.03752 Installed Version: Enterprise Visual C++ 2019 00435-60000-00000-AA978 Microsoft Visual C++ 2019 ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools Application Insights Tools for Visual Studio Package 9.1.00913.1 Application Insights Tools for Visual Studio ASP.NET and Web Tools 2019 16.3.286.43615 ASP.NET and Web Tools 2019 ASP.NET Web Frameworks and Tools 2019 16.3.286.43615 For additional information, visit https://www.asp.net/ Azure App Service Tools v3.0.0 16.3.286.43615 Azure App Service Tools v3.0.0 Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer. Azure Data Lake Tools for Visual Studio 2.3.9000.0 Microsoft Azure Data Lake Tools for Visual Studio Azure Functions and Web Jobs Tools 16.3.286.43615 Azure Functions and Web Jobs Tools Azure Stream Analytics Tools for Visual Studio 2.3.9000.0 Microsoft Azure Stream Analytics Tools for Visual Studio C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Extensibility Message Bus 1.2.0 (d16-2@8b56e20) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events FormatDocumentOnSave 1.0 Enables auto formatting of the code when you save a file. Visual Studio supports auto formatting of the code with the CTRL+E,D or CTRL+E,F key shortcuts but with this extension the command 'Format Document' is executed on Save. You can find the source here: https://github.com/Elders/VSE-FormatDocumentOnSave IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info Microsoft Azure HDInsight Azure Node 2.3.9000.0 HDInsight Node under Azure Node Microsoft Azure Hive Query Language Service 2.3.9000.0 Language service for Hive query Microsoft Azure Service Fabric Tools for Visual Studio 2.5 Microsoft Azure Service Fabric Tools for Visual Studio Microsoft Azure Stream Analytics Language Service 2.3.9000.0 Language service for Azure Stream Analytics Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1 Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft Library Manager 2.0.83+gbc8a4b23ec Install client-side libraries easily to any web project Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container. Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package Mono Debugging for Visual Studio 16.3.7 (9d260c5) Support for debugging Mono processes with Visual Studio. MySQL for Visual Studio 1.2.9 Data design and management tools for MySQL. Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. NuGet Package Manager 5.3.1 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info SQL Server Data Tools 16.0.61908.27190 Microsoft SQL Server Data Tools Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory. Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory. ToolWindowHostedEditor 1.0 Hosting json editor into a tool window TypeScript Tools 16.0.10821.2002 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823 Microsoft Visual F# Tools 10.4 for F# 4.6 Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes Visual Studio Tools for Unity 4.3.3.0 Visual Studio Tools for Unity VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 16.3.0.281 (d16-3@859f726) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 16.3.0.256 (remotes/origin/d16-3@8a223bfd7) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 16.3.565 (27e9746) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 10.0.6.2 (d16-3/c407838) Xamarin.Android Reference Assemblies and MSBuild support. Mono: mono/mono/2019-06@476d72b9e32 Java.Interop: xamarin/java.interop/d16-3@5836f58 LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94 LibZip: nih-at/libzip/rel-1-5-1@b95cf3fd ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.27.1@8212a2d Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333 Xamarin.iOS and Xamarin.Mac SDK 13.6.0.12 (e3c2b40) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.


Original Comments

Visual Studio Feedback System on 1/5/2020, 10:16 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Anna Melashkina on 1/7/2020, 00:17 AM:

Sorry, could you move this topic to .NET?


Original Solutions

(no solutions)

bug needs-winui-3 team-Rendering

Most helpful comment

Thanks @aosyatnik for logging this issue. This is a fun bug.

It took me a while to narrow down to the necessary pieces for a minimal repro. A small repro can be achieved with this markup inside the default Grid in the MainPage.xaml of a new app project:

        <Grid Background="DarkGray" RenderTransformOrigin="0.5,0.5">
            <Grid.RenderTransform>
                <RotateTransform Angle="-90" />
            </Grid.RenderTransform>
            <Grid.Resources>
                <Storyboard x:Name="sb">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="projection" Storyboard.TargetProperty="(PlaneProjection.RotationX)">
                        <EasingDoubleKeyFrame KeyTime="00:00:00" Value="-90" />
                        <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="-90" />
                        <EasingDoubleKeyFrame KeyTime="00:00:01.5" Value="0" />
                        <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </Grid.Resources>
            <StackPanel Width="200" Background="Blue">
                <StackPanel.Projection>
                    <PlaneProjection x:Name="projection" RotationX="0" />
                </StackPanel.Projection>
            </StackPanel>
        </Grid>

Plus this line at the end of the MainPage constructor in MainPage.xaml.cs:

            sb.Begin();

If I change the outer rotation to be slightly off -90, then the problem doesn't repro. Similarly, if I change the RotationX animation to animate to slightly off 0, then the problem doesn't repro. So something about being at those nice round numbers is required to hit this rendering bug.

I've determined that this is a bug in the Composition layer, and logged an internal issue to track this (https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/24806368). This might also be something which can be fixed in WinUI3.

All 5 comments

@codendone This might be an issue with the toolkit control but I've put it on you first.

This was my issue. You can connect to me if you need more details.

Thanks @aosyatnik for logging this issue. This is a fun bug.

It took me a while to narrow down to the necessary pieces for a minimal repro. A small repro can be achieved with this markup inside the default Grid in the MainPage.xaml of a new app project:

        <Grid Background="DarkGray" RenderTransformOrigin="0.5,0.5">
            <Grid.RenderTransform>
                <RotateTransform Angle="-90" />
            </Grid.RenderTransform>
            <Grid.Resources>
                <Storyboard x:Name="sb">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="projection" Storyboard.TargetProperty="(PlaneProjection.RotationX)">
                        <EasingDoubleKeyFrame KeyTime="00:00:00" Value="-90" />
                        <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="-90" />
                        <EasingDoubleKeyFrame KeyTime="00:00:01.5" Value="0" />
                        <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </Grid.Resources>
            <StackPanel Width="200" Background="Blue">
                <StackPanel.Projection>
                    <PlaneProjection x:Name="projection" RotationX="0" />
                </StackPanel.Projection>
            </StackPanel>
        </Grid>

Plus this line at the end of the MainPage constructor in MainPage.xaml.cs:

            sb.Begin();

If I change the outer rotation to be slightly off -90, then the problem doesn't repro. Similarly, if I change the RotationX animation to animate to slightly off 0, then the problem doesn't repro. So something about being at those nice round numbers is required to hit this rendering bug.

I've determined that this is a bug in the Composition layer, and logged an internal issue to track this (https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems/edit/24806368). This might also be something which can be fixed in WinUI3.

@codendone something wrong with the comment? I don't see any inner tags, maybe needs triple backtick quotes to display xml correctly?

Oops. Thanks, @weltkante. I apparently forgot to check that the final result displayed correctly. It should be fixed now.

Was this page helpful?
0 / 5 - 0 ratings