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

fix(macos): prevent transparency leakage/flash in new/resized surfaces #5083

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

qwerasd205
Copy link
Collaborator

Fixes #4516

By using the CAMetalLayer's backgroundColor property instead of drawing the background color in our shader, it is always stretched to cover the full surface, even when live-resizing, and it doesn't require us to draw a frame for it to be initialized so there's no transparent flash when a new surface is created (as in a new split/tab).

This commit also allows for hot reload of background-opacity, window-vsync, and window-colorspace.

By using the `CAMetalLayer`'s `backgroundColor` property instead of
drawing the background color in our shader, it is always stretched to
cover the full surface, even when live-resizing, and it doesn't require
us to draw a frame for it to be initialized so there's no transparent
flash when a new surface is created (as in a new split/tab).

This commit also allows for hot reload of `background-opacity`,
`window-vsync`, and `window-colorspace`.
@mitchellh
Copy link
Contributor

Looks great. Thank you!

@mitchellh mitchellh merged commit ff9414d into ghostty-org:main Jan 15, 2025
30 checks passed
@github-actions github-actions bot added this to the 1.1.0 milestone Jan 15, 2025
@qwerasd205 qwerasd205 deleted the bg-color-layer branch January 15, 2025 20:13
@edrozenberg
Copy link

I builtff9414d9 on MacOS, can confirm all flashing is gone, no flashing at all creating/closing windows/tabs, no flashing resizing splits. A fantastic QOL (Quality of Legendary Status) improvement. Thank you! 🌟 🔭 👻

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.

macOS: background bleeds/flicker when resizing splits, creating tabs
3 participants