Skip to content

Commit 2b0af98

Browse files
committed
fix: replace XWayland backend with Wayland in Wayland sessions
Replace XWayland with Wayland in Wayland sessions. Closes: #387
1 parent f17fb76 commit 2b0af98

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/Core/Main.vala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,22 @@ public class Main : GLib.Object{
385385
}
386386

387387
// copy all required enviroment vars from the user to this process
388-
string[] targets = {"DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS"};
388+
string[] targets = {"GTK_THEME", "DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS"};
389389
foreach (string target in targets) {
390390
string user_var = TeeJee.ProcessHelper.get_env(user_env, target);
391391
if(user_var != null) {
392392
GLib.Environment.set_variable(target, user_var, true);
393393
}
394394
}
395+
396+
string xdg_runtime_dir = TeeJee.ProcessHelper.get_env(user_env, "XDG_RUNTIME_DIR");
397+
string wayland_display = TeeJee.ProcessHelper.get_env(user_env, "WAYLAND_DISPLAY");
398+
399+
if (wayland_display != null && xdg_runtime_dir != null) {
400+
string path = "%s/%s".printf(xdg_runtime_dir, wayland_display);
401+
GLib.Environment.set_variable("WAYLAND_DISPLAY", path, true);
402+
GLib.Environment.set_variable("XDG_RUNTIME_DIR", "/run/user/0", true);
403+
}
395404
}
396405

397406
private int[]? get_btrfs_version_array () {

src/timeshift-launcher

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ else
1313
else
1414
# script is running in non-interactive mode
1515
if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then
16-
xhost +SI:localuser:root
1716
pkexec "${app_command}"
18-
xhost -SI:localuser:root
19-
xhost
2017
elif command -v pkexec >/dev/null 2>&1; then
2118
pkexec "${app_command}"
2219
elif command -v sudo >/dev/null 2>&1; then

0 commit comments

Comments
 (0)