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

Set the main thread's apartment state when initializing GDK #869

Merged
merged 1 commit into from
May 14, 2023

Conversation

cameronwhite
Copy link
Contributor

This seems to be the logical place to do it since the startup error comes from GDK, and this also ensures it's done automatically without any extra steps to document for users.

This is wrapped in a check for whether we're running on Windows, to avoid warnings from the SupportedOSPlatform attribute on SetApartmentState()

I've tested on Windows with Samples/Gtk-4.0/Window and verified that this works

Fixes: #864

  • I agree that my contribution may be licensed either under MIT or any version of LGPL license.

This seems to be the logical place to do it since the startup error comes from GDK, and this also ensures it's done automatically without any extra steps to document for users.

This is wrapped in a check for whether we're running on Windows, to avoid warnings from the `SupportedOSPlatform` attribute on `SetApartmentState()`

Fixes: #864
Copy link
Member

@badcel badcel left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you very much 👍.

@badcel badcel merged commit 1ce0888 into main May 14, 2023
@badcel badcel deleted the fix/apartment-state branch May 14, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows 11 - Gdk-ERROR: OleInitialize failed
2 participants