zed icon indicating copy to clipboard operation
zed copied to clipboard

[Linux]: Window is transparent when viewing image with transparent background

Open yuqiang-yuan opened this issue 1 year ago • 6 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When open a image with transparent background, e.g. ico or png, the editor window is transparent. Screenshot from 2024-10-07 16-47-15

Environment

Zed: v0.155.2 (Zed) OS: Linux X11 ubuntu 24.04 Memory: 31.2 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 4060 Ti || NVIDIA || 535.183.01

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

yuqiang-yuan avatar Oct 07 '24 09:10 yuqiang-yuan

This appears to be Linux specific. Transparent images display as expected for me on MacOS.

turtle

notpeter avatar Oct 07 '24 13:10 notpeter

Can confirm on Wayland as well, the checkerboard background of the image viewer is semi-transparent regardless of whether or not the theme has a transparent background.

jansol avatar Oct 08 '24 13:10 jansol

The checkerboard drawing is also affecting alpha, I don't see a good reason why it should do that on any platform, so I think changing opacity to 1. should fix it?

bbb651 avatar Oct 09 '24 12:10 bbb651

The bigger question here IMHO is why it overrides/skips the alpha of the window background, which should be 1.0 in non-transparent themes. Blending a semi-transparent checkerboard on top of the window background does still make some sense (it tints the checkerboard), although I'd probably want the checkerboard to be configurable in terms of opacity and brightness/contrast either way.

jansol avatar Oct 09 '24 12:10 jansol

I don't think it overrides the alpha of the window? I cannot reproduce it when setting background to #xxxxxxff. Unlike other platforms, on wayland background.appearance is only used as an hint for the compositor if the background is transparent and doesn't disable transparency, which is probably the real bug (it can also cause broken visuals when it's set to opaque and transparency is less than 1.0 because the compositor is allowed to assume that's impossible). Also, it's a little odd that background blends there's, but not on e.g. the status bar.. image

bbb651 avatar Oct 09 '24 13:10 bbb651

Hm, that's weird. That would imply that the builtin Ayu Dark theme I checked with does not specify an opaque background color - but it does.

jansol avatar Oct 09 '24 13:10 jansol

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!

github-actions[bot] avatar Mar 18 '25 15:03 github-actions[bot]

No this issue on Zed 0.177. issue closed

yuqiang-yuan avatar Mar 19 '25 02:03 yuqiang-yuan