Description
- .NET Core Version 3.1
- Windows version: 1903
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Problem description:
When using display with variable refresh rate (I only tested it on G-Sync one, but my guess is that the issue will occur on FreeSync too due to the nature of this behavior) the general user experience is not smooth and feels very unresponsive. The issue is that WPF (being DirectX application) is picked up by the display driver and display refresh is adjusted based on framerate output of WPF. However since WPF's framerate is usually bellow 60, this has a big impact on general responsiveness of the interface because even things like moving mouse will be noticeable stuttery. More so if user has display with high refresh rate (like 144Hz), the switch to and from WPF application can be quite jarring.
Expected behavior:
WPF's framerate is not picked up by the graphics driver and refresh rate stays static when using said app. For example I didn't notice this being an issue with UWP or other desktop applications with accelerated GPU rendering.
I understand that technically this is working as intended, but in my opinion it doesn't make much sense for WPF application to be VRR compatible, given the type of applications that are generally created with it. I think it would make more sense to have VRR compatibly turned off by default, but have an option to enable old behavior if possible.
I think this shouldn't be taken lightly since VRR display use is on rise and it's become de facto standard in gaming related PCs (I develop gaming related app and quite a few users noticed this issue).
Minimal repro:
This simple example can be used to reproduce the behavior. Just moving mouse over list box items will force display to render at about 30 fps.
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="450" Width="800">
<Grid>
<ListBox>
<ListBoxItem>test</ListBoxItem>
<ListBoxItem>test</ListBoxItem>
<ListBoxItem>test</ListBoxItem>
</ListBox>
</Grid>
</Window>