Skip to content

Fix macOS Metal window transparency#1501

Closed
vcali wants to merge 9 commits into
raphamorim:mainfrom
vcali:codex/fix-macos-metal-transparency
Closed

Fix macOS Metal window transparency#1501
vcali wants to merge 9 commits into
raphamorim:mainfrom
vcali:codex/fix-macos-metal-transparency

Conversation

@vcali
Copy link
Copy Markdown

@vcali vcali commented Apr 12, 2026

Closes #1500.

Summary

  • preserve alpha on the direct macOS Metal path instead of forcing the drawable/window background back to opaque
  • let transparent Metal windows use the Cocoa window background tint instead of clearing the Metal drawable with a semi-transparent terminal background
  • keep the custom macOS view/layer non-opaque so AppKit/Core Animation can composite the window correctly
  • add focused renderer tests for the new transparency decision logic

Root cause

The 0.3.x macOS Metal path could still end up visually opaque even with window.opacity < 1.0 because background updates restored alpha to 1.0, and the renderer was still clearing the Metal drawable directly for transparent windows.

Testing

  • cargo test -p rioterm

@raphamorim
Copy link
Copy Markdown
Owner

I apologise taking time to reply, will look this soon

@vcali
Copy link
Copy Markdown
Author

vcali commented Apr 16, 2026

I'll fix the conflicts later today

@vcali vcali force-pushed the codex/fix-macos-metal-transparency branch 2 times, most recently from 25f89b6 to 258cfd6 Compare April 19, 2026 14:37
@aekasitt
Copy link
Copy Markdown

aekasitt commented Apr 20, 2026

Installed via cargo as such

cargo install --git https://github.com/raphamorim/rio.git --rev refs/pull/1501/head

Works !!


Workstation details: Apple M1 Pro (Tahoe 26.3)

@raphamorim raphamorim force-pushed the main branch 2 times, most recently from d4a196a to c880c19 Compare April 23, 2026 19:33
@vcali vcali force-pushed the codex/fix-macos-metal-transparency branch from 8ee2dfb to 12271d5 Compare April 25, 2026 18:11
@lazo4
Copy link
Copy Markdown

lazo4 commented Apr 26, 2026

It worked for me a few days ago, but when I try it now, I get:
Capture d’écran 2026-04-26 à 16 58 11
Notes: I have an M1 MacBook Air, running macos 26.4

@vcali
Copy link
Copy Markdown
Author

vcali commented Apr 29, 2026

@lazo4 can you get me your config please?

@lazo4
Copy link
Copy Markdown

lazo4 commented Apr 29, 2026

Sure, I reduced it to the minimal config:

[window]
opacity = 0.5
blur = true

All the other options have been left to their defaults

Important Note

It used to work a few weeks ago when I first tried it, so it’s possible something broke in main.
I also have this issue on my 2019 Intel imac, which is running macos 15.7.4.

@raphamorim raphamorim mentioned this pull request May 2, 2026
@raphamorim
Copy link
Copy Markdown
Owner

Should be fixed in #1576 thank you !

@vcali vcali deleted the codex/fix-macos-metal-transparency branch May 3, 2026 13:37
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 Metal transparency stays opaque in 0.3.x

4 participants