mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Use a better workaround for Wayland crashes.
GoldenDict use lots of X11 functions and it currently cannot work natively on Wayland. This workaround will force GoldenDict to use XWayland. Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
This commit is contained in:
parent
db93bd19d3
commit
6ca112b797
11
main.cc
11
main.cc
|
@ -212,6 +212,17 @@ public:
|
||||||
|
|
||||||
int main( int argc, char ** argv )
|
int main( int argc, char ** argv )
|
||||||
{
|
{
|
||||||
|
#ifdef Q_OS_UNIX
|
||||||
|
// GoldenDict use lots of X11 functions and it currently cannot work
|
||||||
|
// natively on Wayland. This workaround will force GoldenDict to use
|
||||||
|
// XWayland.
|
||||||
|
char * xdg_envc = getenv("XDG_SESSION_TYPE");
|
||||||
|
QString xdg_session = xdg_envc ? QString::fromLatin1(xdg_envc) : QString();
|
||||||
|
if (!QString::compare(xdg_session, QString("wayland"), Qt::CaseInsensitive))
|
||||||
|
{
|
||||||
|
setenv("QT_QPA_PLATFORM", "xcb", 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
setenv("LANG", "en_US.UTF-8", 1);
|
setenv("LANG", "en_US.UTF-8", 1);
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,3 @@ GenericName=Multiformat Dictionary
|
||||||
Comment=GoldenDict
|
Comment=GoldenDict
|
||||||
Icon=goldendict
|
Icon=goldendict
|
||||||
Exec=goldendict
|
Exec=goldendict
|
||||||
Actions=X11;
|
|
||||||
|
|
||||||
[Desktop Action X11]
|
|
||||||
Name=GoldenDict (X11)
|
|
||||||
Exec=env QT_QPA_PLATFORM=xcb goldendict
|
|
||||||
|
|
Loading…
Reference in a new issue