Skip to content

Commit

Permalink
qt gui: default to QT_QPA_PLATFORM=xcb for AppImage
Browse files Browse the repository at this point in the history
The wayland plugin would require at least debian 12 (or ubuntu 22.04) at runtime.

see #9189 (review) :

> I've now tried running the appimage on debian 10 (oldoldstable), and am getting an error with wayland.
>
> ```
>   4.16 | D | util.profiler | Plugins.__init__ 0.0422 sec
>   4.16 | I | daemon.Daemon | launching GUI: qt
>   4.76 | I | gui.qt.ElectrumGui | Qt GUI starting up... Qt=6.7.1, PyQt=6.7.1
> /tmp/.mount_electrFlGFOt/usr/bin/python3: symbol lookup error: /tmp/.mount_electrFlGFOt/usr/lib/python3.11/site-packages/PyQt6/Qt6/plugins/platforms/../../lib/libQt6WaylandClient.so.6: undefined symbol: wl_proxy_marshal_flags
> ```
>
> If I explicitly specify `QT_QPA_PLATFORM=xcb`, it starts and works as expected. But it picks wayland by default.
> I found https://bugreports.qt.io/browse/QTBUG-114635 and it looks like even debian 11 might be affected.
  • Loading branch information
SomberNight committed Sep 17, 2024
1 parent 8d342e9 commit 0fb20cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions electrum/gui/qt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
except ImportError as e:
pass # failure is ok; it is an optional dependency.

if sys.platform == "linux" and os.environ.get("APPIMAGE"):
# For AppImage, we default to xcb qt backend, for better support of older system.
# qt6 normally defaults to QT_QPA_PLATFORM=wayland instead of QT_QPA_PLATFORM=xcb.
# However, the wayland QPA plugin requires libwayland-client0>=1.19, which is too new
# for debian 11 or ubuntu 20.04. So instead, we default to the X11 integration (and not wayland).
# see https://bugreports.qt.io/browse/QTBUG-114635
os.environ.setdefault("QT_QPA_PLATFORM", "xcb")

from electrum.i18n import _, set_language
from electrum.plugin import run_hook
from electrum.util import (UserCancelled, profiler, send_exception_to_crash_reporter,
Expand Down

0 comments on commit 0fb20cc

Please sign in to comment.