diff --git a/fcitx-autostart-check-INPUT_METHOD.patch b/fcitx-autostart-check-INPUT_METHOD.patch new file mode 100644 index 0000000..23bead8 --- /dev/null +++ b/fcitx-autostart-check-INPUT_METHOD.patch @@ -0,0 +1,14 @@ +--- + data/script/fcitx-autostart | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/data/script/fcitx-autostart ++++ b/data/script/fcitx-autostart +@@ -1,5 +1,7 @@ + #!/bin/sh + ++test x"$INPUT_METHOD" = x"fcitx" || exit 0 ++ + # sleep for a little while to avoid duplicate startup + sleep 2 + diff --git a/fcitx-use-basename-for-log.patch b/fcitx-use-basename-for-log.patch new file mode 100644 index 0000000..c18499d --- /dev/null +++ b/fcitx-use-basename-for-log.patch @@ -0,0 +1,23 @@ +--- + src/lib/fcitx-utils/log.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/lib/fcitx-utils/log.c ++++ b/src/lib/fcitx-utils/log.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "config.h" + #include "fcitx/fcitx.h" +@@ -136,7 +137,7 @@ FcitxLogFunc(FcitxLogLevel e, const char + { + va_list ap; + va_start(ap, fmt); +- FcitxLogFuncV(e, filename, line, fmt, ap); ++ FcitxLogFuncV(e, basename(filename), line, fmt, ap); + va_end(ap); + } + diff --git a/fcitx.changes b/fcitx.changes index 483a12c..0c4e19e 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Thu Oct 22 16:02:07 CEST 2015 - tiwai@suse.de + +- Fix logging not to include the build path (boo#951602): + fcitx-use-basename-for-log.patch + +------------------------------------------------------------------- +Thu Oct 22 14:59:29 CEST 2015 - tiwai@suse.de + +- Several fixes and cleanup for starting fcitx on GNOME on Leap + (boo#947576,boo#942816) + * Remove the superfluous manual dbus-launch from xim script + * Use xdg autostart for GNOME, KDE, LXDE and XFCE; + fcitx-autostart script is also modified to check $INPUT_METHOD: + fcitx-autostart-check-INPUT_METHOD.patch + * Delay start of fcitx daemon a bit, too + ------------------------------------------------------------------- Fri Oct 2 02:50:30 UTC 2015 - i@marguerite.su diff --git a/fcitx.spec b/fcitx.spec index 9496905..54f9cac 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -33,6 +33,10 @@ Source8: openSUSE-themes.tar.gz Source9: macros.%{name} Source99: baselibs.conf Patch: fcitx-4.2.8.5-fix-bashisms.patch +# PATCH-FIX-OPENSUSE fcitx-use-basename-for-log.patch boo#951602 +Patch1: fcitx-use-basename-for-log.patch +# PATCH-FIX-OPENSUSE fcitx-autostart-check-INPUT_METHOD.patch boo#947576 +Patch2: fcitx-autostart-check-INPUT_METHOD.patch BuildRequires: cairo-devel BuildRequires: dbus-1-devel BuildRequires: dbus-1-glib-devel @@ -356,6 +360,8 @@ You can either use this package for download from kde-look.org using knewstaff i %prep %setup -q -n %{name}-%{version} %patch -p1 +%patch1 -p1 +%patch2 -p1 # hack to fix incompatibility of gtk-query-immodules-2.0 (bnc#845860) %if %suse_version < 1310 sed -i \ @@ -450,9 +456,6 @@ pushd %{buildroot}%{_sysconfdir}/X11/xim.d/ done popd -# bnc#801319 remove the unneeded fcitx-autostart.desktop which blocks ibus from starting. -rm -rf %{buildroot}%{_sysconfdir}/xdg/autostart/%{name}-autostart.desktop - # install rpm macros install -D -m644 %{SOURCE9} %{buildroot}%{_sysconfdir}/rpm/macros.%{name} @@ -519,6 +522,7 @@ exit 0 %{_mandir}/man1/fcitx.1.gz %{_mandir}/man1/fcitx-remote.1.gz %{_libdir}/%{name}/ +%{_sysconfdir}/xdg/autostart/%{name}*.desktop %config %{_sysconfdir}/X11/xim.d/ %doc %{_docdir}/%{name}/ diff --git a/xim.d-fcitx b/xim.d-fcitx index c805355..2f10a6b 100644 --- a/xim.d-fcitx +++ b/xim.d-fcitx @@ -5,12 +5,17 @@ export GTK_IM_MODULE=fcitx export QT_IM_SWITCHER=imsw-multi export QT_IM_MODULE=fcitx -# Avoid relying on autolaunch to improvise D-Bus sessions for each process -if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] ; then - eval $(dbus-launch --sh-syntax --exit-with-session) -fi - -fcitx -d +case "$WINDOWMANAGER" in + *gnome*|*kde*|*xfce*|*lxde*) + # started via xdg autostart (boo#947576) + # explicitly set below, as referred in xdg autostart + export INPUT_METHOD=fcitx + ;; + *) + # FIXME: a little bit of delay is required to avoid race (boo#947576) + (sleep 2; fcitx -d) & + ;; +esac # success: return 0