mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
134 stars 73 forks source link

mate-terminal on Wayland improperly sets $DISPLAY="wayland-0" #423

Closed furryfixer closed 1 year ago

furryfixer commented 1 year ago

Expected behaviour

"echo $DISPLAY" should reflect/inherit setting from the desktop environment , and $DISPLAY should NOT be same as $WAYLAND_DISPLAY.

Actual behaviour

$DISPLAY is set to "wayland_0", or I suspect equals $WAYLAND_DISPLAY. This leads to errors for Xwayland clients invoked from mate-terminal. Note that invoking "mate-terminal --display=$DISPLAY" works correctly.

Steps to reproduce the behaviour

Start mate-terminal from within a wayland session. echo $DISPLAY

MATE general version

1.26.0

Package version

1.26.0-1

Linux Distribution

Both Void (non-systemd) and Arch (systemd) distributions affected. Error occurs in both Gnome-wayland and Plasma5-Wayland on both.

Link to bugreport of your Distribution (requirement)

Multiple DEs and distros affected, Problem is upstream.

llyyr commented 1 year ago

This is because of mate-terminal messing around with the DISPALY env variable here: https://github.com/mate-desktop/mate-terminal/blob/master/src/terminal-screen.c#L1476

The solution is to just delete this line

lukefromdc commented 1 year ago

That works, note that if mate-panel was previously invoked from a prior build of mate-terminal it will itself inherit and thus set this same incorrect DISPLAY variable. To test in wayland it is thus necessary to restart mate-terminal and anything started from it that will be used in the next invocation of mate-terminal. Then GIMP, Kdenlive, and even xterm all start up just fine in wayfire from mate-terminal.

Will push a PR for this

lukefromdc commented 1 year ago

https://github.com/mate-desktop/mate-terminal/pull/437 should fix this, worked here

furryfixer commented 1 year ago

Concur this fixes the issue. Fix is so simple, I see no reason to keep open. Closing.

raveit65 commented 1 year ago

Is it Ok that echo $DISPLAY gives an empty result after fix in wayland (miral-shell)?

lukefromdc commented 1 year ago

I don't know a whole lot about that, but I am at least now able to open apps in xwayland.

As mentioned in the PR, in x11 if I run envin terminal the output includes DISPLAY=:0 in wayfire it includes DISPLAY=:1 and so far I haven't had any problems

raveit65 commented 1 year ago

Indeed, under wayfire i have DISPLAY=:1, it might be a configuration issue with mis session which i had setup quick today.

furryfixer commented 1 year ago

Not my area of expertise, but I thought Xwayland provided/forwarded a $DISPLAY variable? Perhaps is is the DE using Xwayland that does this. As long as mate-terminal does not overwrite $DISPLAY, it should work like other X11 terminal apps on Wayland.