alacritty / alacritty

A cross-platform, OpenGL terminal emulator.
https://alacritty.org
Apache License 2.0
56.47k stars 3.03k forks source link

opacity doesn't work inside VM #4217

Open c02y opened 4 years ago

c02y commented 4 years ago

For bug reports, the following information can help speed up the process. Please describe the bug that you have found and what you would expect to happen instead.

I can set background transparent in both kitty and xfce4-terminal, but the background_opacity in alacritty.yml file doesn't work at all.

BTW: I got two environments, Manjaro+XFCE running inside VMware(Windows10 Host), Manjaro+KDE running without VMware, on two computers. Manjaro+XFCE running inside VMware(Windows10 host), background_opacity for alacritty doesn't work at all. Manjaro+KDE running without VMware, background_opacity for alacritty works OK.

System

OS: Linux/BSD/macOS/Windows 5.7.15-1-MANJARO Version: alacritty --version output alacritty 0.5.0 Linux/BSD: X11/Wayland, DE or Compositor and WM XFCE4 Windows: WinPTY/ConPTY (see alacritty -v output)

Logs

NOTE: the ~/.alacritty.yml is the copied from /usr/share/doc/alacritty/example/alacritty.yml, the only difference is I changed background_opacity

Crashes: STDERR, STDOUT Font/Terminal size: alacritty -vv

eated log file at "/tmp/Alacritty-1961526.log"
[2020-09-10 10:21:15.553313074] [INFO] Welcome to Alacritty
[2020-09-10 10:21:15.553582044] [INFO] Configuration loaded from "/home/chz/.alacritty.yml"
[2020-09-10 10:21:15.572579550] [DEBUG] Estimated DPR: 1
[2020-09-10 10:21:15.572720799] [DEBUG] Estimated Cell Size: 9 x 17
[2020-09-10 10:21:15.572767342] [DEBUG] Estimated Dimensions: None
libEGL warning: DRI2: failed to authenticate
[2020-09-10 10:21:15.658639489] [INFO] Device pixel ratio: 1
[2020-09-10 10:21:15.675633080] [INFO] Initializing glyph cache...
[2020-09-10 10:21:15.708702490] [INFO] ... finished initializing glyph cache in 0.032946838s
[2020-09-10 10:21:15.708802355] [INFO] Cell Size: 9 x 17
[2020-09-10 10:21:15.708841802] [INFO] Padding: 0 x 0
[2020-09-10 10:21:15.708881409] [INFO] Width: 800, Height: 600
[2020-09-10 10:21:15.712123004] [INFO] PTY dimensions: Line(35) x Column(88)
[2020-09-10 10:21:15.734415167] [INFO] Initialisation complete
[2020-09-10 10:21:15.749278870] [DEBUG] Term::resize dimensions unchanged
[2020-09-10 10:21:15.749553916] [INFO] Width: 800, Height: 600

Keyboard and bindings: alacritty --print-events

Info: the left one is xfce4-terminal(transparent=0.5 in its Preferences), the middle one is alacritty with background_opacity=0.0, the right one is alacritty with background_opacity=1.0, you can see that changing background_opacity has some effect, just not transparent as expected.

image

chrisduerr commented 4 years ago

So it works fine on one of your systems? Have you made sure the config is in the right location and a compositor is running?

c02y commented 4 years ago

So it works fine on one of your systems? Have you made sure the config is in the right location

As I said “the middle one is alacritty with background_opacity=0.0, the right one is alacritty with background_opacity=1.0, you can see that changing background_opacity has some effect, just not transparent as expected.”, if the config is not in the right location, how background_opacity=1.0 and background_opacity=0.0 have different effects? I know the basic info of the config file, and I can set a lot of things in it, just don't know why background_opacity does not work as expected in XFCE.

and a compositor is running?

As I said, "I can set background transparent in both kitty and xfce4-terminal", if a compositor is not running, how the background of them can be transparent?

chrisduerr commented 4 years ago

Could you share your config please?

As I said, "I can set background transparent in both kitty and xfce4-terminal", if a compositor is not running, how the background of them can be transparent?

There are applications that implement a poor man's transparency by copying content from the root window themselves.

c02y commented 4 years ago

Could you share your config please?

As I said, "I can set background transparent in both kitty and xfce4-terminal", if a compositor is not running, how the background of them can be transparent?

There are applications that implement a poor man's transparency by copying content from the root window themselves.

I checked, the compositor is already enabled in XFCE4 Settings.

And as I said: "NOTE: the ~/.alacritty.yml is the copied from /usr/share/doc/alacritty/example/alacritty.yml, the only difference is I changed background_opacity"

chrisduerr commented 4 years ago

Can you reproduce this with Manjaro+XFCE outside of a VM? Also please just share your configuration file, that's much easier than telling me what you've changed and much more helpful for troubleshooting.

c02y commented 4 years ago

alacritty.zip

Can you reproduce this with Manjaro+XFCE outside of a VM?

I'm afraid not, I have no hardware to install a new OS currently.

Zachu commented 4 years ago

I'm experiencing the same issue but on i3 and Ubuntu 18.04.5. gnome-terminal has transparency, alacritty has not. It was working previously just fine but I think my latest package upgrade broke it.

My latest upgrade regarding alacritty was from apt log:

Unpacking alacritty (0.5.0~1596299148~18.04~ac39dfd) over (0.4.3)
$ apt show alacritty |grep Version
Version: 0.5.0~1596299148~18.04~ac39dfd

$ alacritty --version             
alacritty 0.6.0-dev

I do use the this ppa https://launchpad.net/~mmstick76/+archive/ubuntu/alacritty so I guess that's a bit unsupported way :) I have not tried to compile this myself.

chrisduerr commented 4 years ago

@Zachu Do you have a compositor installed? Transparency definitely works on i3 I can confirm that myself.

Zachu commented 4 years ago

@Zachu Do you have a compositor installed? Transparency definitely works on i3 I can confirm that myself.

I do have compton installed and running, yeah. Without that I wouldn't have working transparency on gnome-terminal either but in this case gnome-terminal does work correctly.

$ pgrep -a compton
19281 compton -f

$ compton --version
0.1~beta2+20150922

I'm pretty sure this was caused by the alacritty package upgrade but I guess it might be the cause of some other related package as well. I just don't have an easy way to roll back because the ppa I'm using doesn't have the older version of the package anymore :)

chrisduerr commented 4 years ago

Opacity definitely works with Alacritty and picom. So if it doesn't for you, you've probably broken some configuration of either Alacritty or picom.

Zachu commented 4 years ago

Opacity definitely works with Alacritty and picom. So if it doesn't for you, you've probably broken some configuration of either Alacritty or picom.

$ grep -v '^\s*#\|^\s*$' ~/.config/alacritty/alacritty.yml
font:
  normal:
    family: monospace
  size: 14.0
draw_bold_text_with_bright_colors: true
colors:
  primary:
    background: '#000000'
background_opacity: 0.8
live_config_reload: true
mouse:
  url:
    modifiers: Control

That config hasn't been touched in a while tho.

I tried also with following configuration but it still did not have transparency.

$ cat ~/.config/alacritty/alacritty.yml
background_opacity: 0.8

I don't have any user-specified configuration on compton, and as I said it still works for gnome-terminal. I can verify that by killing compton and I don't get transparency on gnome-terminal but restarting it gives it back.

Picom doesn't seem to have a prebuilt deb for Ubuntu 18.04 so I can't easily test that. I think I might try building alacritty myself when I have time to do that and find out if I can get it working from an earlier build.

What version of alacritty are you running that seems to work?

chrisduerr commented 4 years ago

What version of alacritty are you running that seems to work?

Basically every single one.

If it worked for you, but doesn't work anymore, why not just try to downgrade the system to see what broke it?

Zachu commented 4 years ago

If it worked for you, but doesn't work anymore, why not just try to downgrade the system to see what broke it?

As I stated above, the ppa I'm using does not have the older version of the package anymore and I don't have an easy way to roll back.

chrisduerr commented 4 years ago

I don't have an easy way to roll back

What stops you from compiling from source?

Zachu commented 4 years ago

I don't have an easy way to roll back

What stops you from compiling from source?

Nothing stops me. As I stated above as well, I might try building it myself to see which version or change introduced the problem.

What I meant by "I don't have an easy way to roll back" is that since my current alacritty set up was not based on self-compiled binary but an external ppa provided deb I don't have a setup to compile alacritty or any other rust programs at the moment. It requires some effort from my part to initialize that first.

But I think this goes a bit offtopic territory now. The opacity is clearly not working for me right now. I don't believe it's config changes that introduced this behaviour but some change in alacritty. I might be wrong of course but I can try to look into it when I have time to do that :)

Zachu commented 4 years ago

Oh by the way, since you do have everything probably set up, are you able to quickly verify that your opacity works if built from ac39dfd03747be096c32073b39786c37972d2cdc? I think that's the commit packaged in the ppa.

Zachu commented 4 years ago

Ok :see_no_evil: Mythical reboot fixed my issue :shrug: Unable to reproduce anyomore. But the OP's issue probably still remains.

davidswarbrick commented 3 years ago

I've reproduced this in an Ubuntu 20.04 VM running under VirtualBox on Windows, Gnome Terminal shows transparency but Alacritty does not ( installed via cargo - 0.8.0). running alacritty -vv shows this error (as mentioned in the original report of the bug):

libEGL warning: DRI2: failed to authenticate

A quick google seems to suggest it's an issue with the VM not having access to HW acceleration. As Ubuntu 20.04 with Gnome comes pre-packaged with gnome-shell as the default compositor switching to compton or another would require a DE switch. I'd hope there may be a workaround to implement transparency in a similar way to gnome-terminal.

Ichinose11 commented 3 years ago

using virtualbox with bspwm background_opacity doesn't seem to be working

poetaman commented 3 years ago

@Ichinose11 Options have changed, now its set using window.opacity & colors.transparent_background_colors

Ichinose11 commented 3 years ago

@Ichinose11 Options have changed, now its set using window.opacity & colors.transparent_background_colors

thanks for the clarification

Ichinose11 commented 3 years ago

@Ichinose11 Options have changed, now its set using window.opacity & colors.transparent_background_colors

i added this command it still took no effect but my other terminals are transparent with picom enabled

alkaris2 commented 2 years ago

Seems like this transparency issue is still a thing, doesn't seem to matter which desktop manager everyone uses, it's all broken and can't render transparent windows despite the values being set, but works perfectly file for any other windows that supports setting transparency.

Cinnamon desktop uses Mutter and has compositor built-in as it's main core feature and it doesn't even work no matter what values are set for window opacity. One-size-fit-all approach doesn't seem to work when you add one setting for setting window transparency.

andradei commented 2 years ago

Same issue with Arch + bspwm + picom. I can set transparency of window (background and text) via picom. But window.opacity doesn't do anything.

john-yan commented 2 years ago

Hello,

here's my VM setup (HostOS: Arch, Qemu+libvirt).

Guest1 setup: Arch + gnome = transparency works image

Guest2 setup: Arch + qtile + picom = not work. image

Updates: Putting "opacity-rule" in ~/.config/picom.conf would work on Guest2.

opacity-rule = [
    "80:class_g = 'Alacritty'",
];

However, the opacity setting in alacritty.yml doesn't have any effect on transparency. image

Nukiloco commented 2 years ago

I'm currently having this bug currently as well running linux mint with picom on virtualbox My host is Windows 10, I'm running with NVIDIA GTX 750 Ti and NVIDIA GTX 1050 Ti 3D Acceleration is enabled and my graphics controller is set to VMSVGA

Leo310 commented 2 years ago

I am facing the same issue in virtual box with picom.

opossalite commented 2 years ago

Same issues here with VBox on Windows 10, VMSVGA (3D Accel on/off doesn't matter). Running Arch/bspwm/picom. Transparency works perfectly with xfce4-terminal and gnome-terminal but not with alacritty.

hexadecagram commented 2 years ago

alacritty 0.10.1 on xwfm 4.16.1 on fbdevhw 21.1.4-1 on Arch on qemu 7.0.0-10 on libvirt 8.5.0-3 on Arch.

When I adjust the opacity setting, the window goes from black (0.0) to gray (1.0) with no apparent transparency.

terminator 2.1.1-3's transparency function performs as expected.

aksu560 commented 2 years ago

Also still facing this issue: Running guest Ubuntu 20.04 in Virtualbox on a Windows 10 Host.

Running i3-gaps directly on top of X, with compton for compositing effects. Terminator, gnome shell, i3 sensible, etc. Have transparency working just fine.

Edit: specified i3-gaps

kchibisov commented 2 years ago

Could you run strace and see whether it's using EGL?

aksu560 commented 2 years ago

Yes, there are calls to /usr/lib/x86_64-linux-gnu/libEGL.so.1

Edit: also calls to /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.1

And to some related /etc/ files

kchibisov commented 2 years ago

Yes, the transparency with EGL on X11 doesn't work. It's a known mesa bug. Use Wayland if you really need it.

gamendez98 commented 1 year ago

I am using manjaro+i3. Just updated alacritty to version 0.11.0-2 and this started happening to me, it looks like the opacity config actually works, its just that it behaves as if the background were black. I changed backend = "xr-glx-hybrid" to backend = "glx" in the picom.config file and now it behaves as expected. it also worked with backend = "xrender"

andradei commented 1 year ago

@gamendez98 You changed backend from what to what? Both values are the same on your comment :)

gamendez98 commented 1 year ago

@andradei Sorry for that, just corrected the comment. Went from backend = "xr-glx-hybrid" to backend = "glx". Thanks for the correction

iworkinpixels commented 1 year ago

Same issue here:

OS: Ubuntu Lunar Lobster Alacritty: 0.11.0 WM: i3 Comp: picom

(alacritty.yml)

[...]
window:
  dimensions:
    columns: 2
    lines: 2 
  padding:
    x: 5
    y: 5
  dynamic_padding: false
  decorations: full 
  startup_mode: Windowed
  opacity: 0.8
[...]