From 863d90a2e7c067910fc4f0684e4061cc9a383784 Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Sun, 15 Mar 2020 10:23:34 +0100 Subject: [PATCH] Added a special desktop action (Run GoldenDict on X11). Created PR to upstream: https://github.com/goldendict/goldendict/pull/1238. --- goldendict-add-x11-action.patch | 28 ++++++++++++++++++++++++++++ goldendict.spec | 9 +++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 goldendict-add-x11-action.patch diff --git a/goldendict-add-x11-action.patch b/goldendict-add-x11-action.patch new file mode 100644 index 0000000..22a8924 --- /dev/null +++ b/goldendict-add-x11-action.patch @@ -0,0 +1,28 @@ +From a1c7c5b3762c292c2620af41428c3c6c3f758f04 Mon Sep 17 00:00:00 2001 +From: Vitaly Zaitsev +Date: Sun, 15 Mar 2020 10:15:58 +0100 +Subject: [PATCH] Added a desktop action as a workaround to crashes on Wayland. + +Also removed deprecated Encoding directive from desktop file. + +Signed-off-by: Vitaly Zaitsev +--- + redist/goldendict.desktop | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/redist/goldendict.desktop b/redist/goldendict.desktop +index e4cbd42b..13a5fe8f 100755 +--- a/redist/goldendict.desktop ++++ b/redist/goldendict.desktop +@@ -5,6 +5,10 @@ Categories=Office;Dictionary;Education;Qt; + Name=GoldenDict + GenericName=Multiformat Dictionary + Comment=GoldenDict +-Encoding=UTF-8 + Icon=goldendict + Exec=goldendict ++Actions=X11; ++ ++[Desktop Action X11] ++Name=GoldenDict (X11) ++Exec=env QT_QPA_PLATFORM=xcb goldendict diff --git a/goldendict.spec b/goldendict.spec index 8ae448d..d347050 100644 --- a/goldendict.spec +++ b/goldendict.spec @@ -9,6 +9,9 @@ License: GPLv3+ URL: http://goldendict.org Source0: https://github.com/%{owner}/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz +# https://github.com/goldendict/goldendict/pull/1238 +Patch100: %{name}-add-x11-action.patch + BuildRequires: cmake(Qt5LinguistTools) BuildRequires: cmake(Qt5XmlPatterns) BuildRequires: cmake(Qt5Multimedia) @@ -56,7 +59,6 @@ Contain doc files of %{name}. %autosetup -n %{name}-%{commit} -p1 rm -r qtsingleapplication sed -e '/qtsingleapplication.pri/d' -i %{name}.pro -cp redist/%{name}.desktop redist/%{name}-x11.desktop %build %qmake_qt5 PREFIX=%{_prefix} CONFIG+=qtsingleapplication CONFIG+=no_ffmpeg_player %{name}.pro @@ -65,11 +67,10 @@ cp redist/%{name}.desktop redist/%{name}-x11.desktop %install %make_install INSTALL_ROOT=%{buildroot} rm -rf %{buildroot}%{_datadir}/app-install -desktop-file-install --set-key=Exec --set-value="env QT_QPA_PLATFORM=xcb %{name}" --set-name="GoldenDict (X11)" --add-only-show-in="GNOME;" --dir=%{buildroot}%{_datadir}/applications redist/%{name}-x11.desktop %check appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml -desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop %files %license LICENSE.txt @@ -78,7 +79,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %dir %{_datadir}/%{name} %{_datadir}/%{name}/locale %{_metainfodir}/%{name}.appdata.xml -%{_datadir}/applications/*.desktop +%{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/%{name}.png %files docs