Skip to content

Fix unnecessary COM initialization on Windows#2578

Merged
hecrj merged 1 commit into
iced-rs:masterfrom
Jinderamarak:fix-drag-drop-flag
Sep 13, 2024
Merged

Fix unnecessary COM initialization on Windows#2578
hecrj merged 1 commit into
iced-rs:masterfrom
Jinderamarak:fix-drag-drop-flag

Conversation

@Jinderamarak

@Jinderamarak Jinderamarak commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

I tracked the issue #2577 back to this commit and the file winit/src/program.rs:L273, where the window is first initialized with default() window options instead of the provided ones.

I am not going to lie, I don't know why we need to create a window with default attributes first and then initialize it again with proper attributes later, but if I change the first initialization to be without drag-and-drop support, then COM is initialized later only when it is really required.

I tested this change with examples/events and the reproduction code from the issue and everything works as I would expect it to on Windows.

Fixes #2577.

@Jinderamarak

Copy link
Copy Markdown
Contributor Author

I would also consider using the window options provided when creating the application in this place, because it would be hard to track all of the flags causing similar side effects.

@hecrj hecrj added bug Something isn't working shell fix labels Sep 13, 2024
@hecrj hecrj added this to the 0.13 milestone Sep 13, 2024
@hecrj hecrj force-pushed the fix-drag-drop-flag branch from 28bfc2f to cadc054 Compare September 13, 2024 22:22

@hecrj hecrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@hecrj hecrj enabled auto-merge September 13, 2024 22:23
@hecrj hecrj changed the title Fix unnecessary COM initialization Fix unnecessary COM initialization on Windows Sep 13, 2024
@hecrj hecrj merged commit 8fb939b into iced-rs:master Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unnecessary COM initialization with drag and drop disabled

2 participants