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

[macOS] Fix driver crash when enabling per-pixel transparency on M1 macs. #55464

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Nov 30, 2021

Fixes #43951

I have no idea why, but apparently driver do not like resizing window to (1 x 1), which was done to force redraw.

[window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, 1, 1) display:YES];
[window_object setFrame:frame display:YES];
NSRect frameRect = [window_object frame];
[window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth adding a comment to clarify the purpose of this call (especially with width + 1, which I guess is to enforce a redraw with a different size?).

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment, yes it's resizing window a bit to trigger GL context update.

@bruvzg bruvzg force-pushed the macos_fix_transp_crash branch from 00f7418 to dd41cf2 Compare November 30, 2021 09:38
@bruvzg bruvzg force-pushed the macos_fix_transp_crash branch from dd41cf2 to f72cc71 Compare November 30, 2021 09:44
@akien-mga akien-mga merged commit 2d42c4d into godotengine:3.x Nov 30, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.1.

@chrisg32
Copy link

chrisg32 commented Dec 5, 2021

Thanks! Much appreciated!

@akien-mga akien-mga changed the title [macOS] Fix driver crash when enabling per-pixel transparency on M1 m… [macOS] Fix driver crash when enabling per-pixel transparency on M1 macs. Dec 8, 2021
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