From 09a2b48a447665755940014b263d8a881383cda6 Mon Sep 17 00:00:00 2001 From: David Yu Yang Date: Fri, 24 Sep 2021 23:47:28 +0800 Subject: [PATCH] Do not set GDK_BACKEND to x11 in terminals. Do not set GDK_BACKEND to x11 in terminals. Don't automatically inherit env variables and manually pass modified env --- guake/terminal.py | 9 +++++++-- releasenotes/notes/fix_gdk_backend-be5c40f221c1e528.yaml | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix_gdk_backend-be5c40f221c1e528.yaml diff --git a/guake/terminal.py b/guake/terminal.py index 1276a5020..ffe353bc9 100644 --- a/guake/terminal.py +++ b/guake/terminal.py @@ -121,6 +121,10 @@ def __init__(self, guake): self.setup_drag_and_drop() + self.ENVV_EXCLUDE_LIST = ["GDK_BACKEND"] + self.envv = [f"{i}={os.environ[i]}" for i in os.environ if i not in self.ENVV_EXCLUDE_LIST] + self.envv.append(f"GUAKE_TAB_UUID={self.uuid}") + def setup_drag_and_drop(self): self.targets = Gtk.TargetList() self.targets.add_uri_targets(DropTargets.URIS) @@ -550,12 +554,13 @@ def spawn_sync_pid(self, directory): Vte.PtyFlags.DEFAULT, directory, argv, - [f"GUAKE_TAB_UUID={self.uuid}"], - GLib.SpawnFlags.DO_NOT_REAP_CHILD, + self.envv, + GLib.SpawnFlags(Vte.SPAWN_NO_PARENT_ENVV | GLib.SpawnFlags.DO_NOT_REAP_CHILD), None, None, None, ) + try: tuple_type = gi._gi.ResultTuple # pylint: disable=c-extension-no-member except: # pylint: disable=bare-except diff --git a/releasenotes/notes/fix_gdk_backend-be5c40f221c1e528.yaml b/releasenotes/notes/fix_gdk_backend-be5c40f221c1e528.yaml new file mode 100644 index 000000000..2a9ee5815 --- /dev/null +++ b/releasenotes/notes/fix_gdk_backend-be5c40f221c1e528.yaml @@ -0,0 +1,6 @@ +release_summary: > + Stopped setting GDK_BACKEND to x11 in terminals. + +fixes: + - | + - GDK_BACKEND is propagated to the shell in terminal #1871