From 91611e50e8679b8859637519af4873a16baadcd8 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Fri, 30 Nov 2018 18:37:12 -0800 Subject: [PATCH] app: workaround broken Qt Wayland widgets in gnome-shell Qt emits a warning when XDG_SESSION_TYPE=wayland and XDG_CURRENT_DESKTOP=GNOME because it is currently an unsupported configuration. Unset XDG_SESSION_TYPE=wayland when in gnome-shell to silence the warning. We will need to revert this commit in the future when [QTBUG-68619](https://bugreports.qt.io/browse/QTBUG-68619) makes Qt Wayland widgets usable in gnome-shell. Signed-off-by: David Aguilar --- cola/app.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cola/app.py b/cola/app.py index 1659de8c..388b6361 100644 --- a/cola/app.py +++ b/cola/app.py @@ -127,6 +127,20 @@ def setup_environment(): # have a chance to explain our merges. compat.setenv('GIT_MERGE_AUTOEDIT', 'no') + # Gnome3 on Debian has XDG_SESSION_TYPE=wayland and + # XDG_CURRENT_DESKTOP=GNOME, which Qt warns about at startup: + # + # Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. + # Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. + # + # This annoying, so we silence the warning. + # We'll need to keep this hack here until a future version of Qt provides + # Qt Wayland widgets that are usable in gnome-shell. + # Cf. https://bugreports.qt.io/browse/QTBUG-68619 + if (core.getenv('XDG_CURRENT_DESKTOP', '') == 'GNOME' + and core.getenv('XDG_SESSION_TYPE', '') == 'wayland'): + compat.unsetenv('XDG_SESSION_TYPE') + def get_icon_themes(context): """Return the default icon theme names""" -- 2.11.4.GIT