Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinRT] Added watchdog for ICompositor5::RequestCommitAsync #16393

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

kekekeks
Copy link
Member

It seems that windows::UI::Composition::ICompositor5.RequestCommitAsync can get stuck if corresponding commit was submitted with rendering produced by a D3D11Device that will become lost afterwards (GetDeviceRemovedReason() still reports that everything is okie-dokie, but in reality the driver could have been reset a minute ago).

The workaround checks if DWM hasn't triggered IAsyncAction completion event for a minute and triggers a next render loop tick regardless.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0050316-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

cbSize = Marshal.SizeOf<UnmanagedMethods.WNDCLASSEX>(),
hInstance = UnmanagedMethods.GetModuleHandle(null),
lpfnWndProc = s_wndProcDelegate,
lpszClassName = s_className = "AvaloniaSimpleWindow-" + Guid.NewGuid(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really descriptive. Having different classnames for offscreen and winui-hack windows might help somebody's in the future.

Copy link
Member Author

@kekekeks kekekeks Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The window class is now reused for all windows to avoid wasting resources for no reason. It's not possible to customize it per-window anymore

@maxkatz6
Copy link
Member

I don't have parallels locally, but I will run in on my windows at least for a sanity check today before merging.
Same changes might be required for DComp timer, but not critical.

@maxkatz6 maxkatz6 added this pull request to the merge queue Jul 24, 2024
Merged via the queue into master with commit e0f0e90 Jul 24, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the fixes/winrt-timer-stuck-device-lost branch July 24, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-rendering backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch bug os-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants