Skip to content

[macOS] Fix running with DisplayServerHeadless.#104660

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
bruvzg:macos_dummy_ds
Mar 28, 2025
Merged

[macOS] Fix running with DisplayServerHeadless.#104660
akien-mga merged 1 commit intogodotengine:masterfrom
bruvzg:macos_dummy_ds

Conversation

@bruvzg
Copy link
Copy Markdown
Member

@bruvzg bruvzg commented Mar 26, 2025

Fixes regression from #104397

Since macOS now using native run loop, this code can be executed even if DisplayServerHeadless is used and static_cast won't work.

Copy link
Copy Markdown
Contributor

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the quick fix!

I can confirm this solves the macOS CI issue on my side 👍

@bruvzg
Copy link
Copy Markdown
Member Author

bruvzg commented Mar 27, 2025

Replaced raw dynamic_cast with Object::cast_to, should work the same.


class DisplayServerMacOS : public DisplayServer {
// No need to register with GDCLASS, it's platform-specific and nothing is added.
GDCLASS(DisplayServerMacOS, DisplayServer); // Note: required for Object::cast_to.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: required for Object::cast_to.

This is currently false, but will be required after #103708

@akien-mga akien-mga merged commit af2fe97 into godotengine:master Mar 28, 2025
20 checks passed
@akien-mga
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants