From c87d9785f4f0b5ca1c02ebe42178dd8bfc38f1ec Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Apr 20 2022 13:18:24 +0000 Subject: Add wrapper script qtpass on GNOME on Wayland has still some issues. This wrapper script makes sure that qtpass is started using XWayland only when the current desktop is GNOME on Wayland. --- diff --git a/qtpass.sh.in b/qtpass.sh.in new file mode 100755 index 0000000..15245cf --- /dev/null +++ b/qtpass.sh.in @@ -0,0 +1,13 @@ +#!/usr/bin/bash +# +# Wrapper script to bypass issues with GNOME on wayland +# + +_QT_QPA_PLATFORM=$QT_QPA_PLATFORM + +if [ "${XDG_SESSION_TYPE,,}" = "wayland" ] && [ -z "$QT_QPA_PLATFORM" ] && { [ "${XDG_CURRENT_DESKTOP,,}" = "gnome" ] || [ "${XDG_SESSION_DESKTOP,,}" = "gnome" ]; } +then + _QT_QPA_PLATFORM="xcb" +fi + +QT_QPA_PLATFORM=$_QT_QPA_PLATFORM exec /__PREFIX__/qtpass "$@" diff --git a/qtpass.spec b/qtpass.spec index eea281e..46ba63d 100644 --- a/qtpass.spec +++ b/qtpass.spec @@ -1,18 +1,21 @@ Name: qtpass Version: 1.3.2 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Cross-platform GUI for pass License: GPLv3 URL: https://qtpass.org/ Source0: https://github.com/IJHack/qtpass/archive/v%{version}.tar.gz +# Wrapper script for GNOME on Wayland +Source1: qtpass.sh.in # required tools -BuildRequires: make +BuildRequires: make BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: git +BuildRequires: sed # required libraries (QT) BuildRequires: qt5-qtbase-devel BuildRequires: qt5-linguist @@ -48,10 +51,17 @@ install -Dpm 644 artwork/icon.svg %{buildroot}%{_datadir}/icons/hicolor/scalable install -Dpm 644 %{name}.appdata.xml %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml install -Dpm 644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 +# Move the qtpass binary and replace it with the wrapper script +install -Dpm 755 %{buildroot}%{_bindir}/qtpass %{buildroot}%{_libexecdir}/qtpass +sed -e 's,/__PREFIX__,%{_libexecdir},g' %{SOURCE1} > %{buildroot}%{_bindir}/qtpass +chmod 755 %{buildroot}%{_bindir}/qtpass + + %files %doc README.md %license LICENSE %{_bindir}/qtpass +%{_libexecdir}/qtpass %{_datadir}/applications/%{name}.desktop %{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/icons/hicolor/scalable/apps/%{name}-icon.svg @@ -59,6 +69,9 @@ install -Dpm 644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 %changelog +* Wed Apr 20 2022 Arthur Bols - 1.3.2-9 +- Added wrapper script that fixes GNOME on Wayland issues. + * Fri Jan 21 2022 Fedora Release Engineering - 1.3.2-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild