From 70b7a4fe796a74230e057c49315f31ea8998185661068d964037a233804f2b81 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 22 Oct 2015 18:05:26 +0000 Subject: [PATCH 1/3] Accepting request 340480 from home:tiwai:branches:M17N - Fix logging not to include the build path (boo#951602) - 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 * Delay start of fcitx daemon a bit, too OBS-URL: https://build.opensuse.org/request/show/340480 OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=124 --- fcitx-autostart-check-INPUT_METHOD.patch | 14 ++++++++++++++ fcitx-use-basename-for-log.patch | 23 +++++++++++++++++++++++ fcitx.changes | 15 +++++++++++++++ fcitx.spec | 10 +++++++--- xim.d-fcitx | 17 +++++++++++------ 5 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 fcitx-autostart-check-INPUT_METHOD.patch create mode 100644 fcitx-use-basename-for-log.patch 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..7dcf1bd 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu Oct 22 16:02:07 CEST 2015 - tiwai@suse.de + +- Fix logging not to include the build path (boo#951602) + +------------------------------------------------------------------- +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 + * 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 From d140f2020caa94da438a97476b5e2e68a6ad412fd31656cb175f426de161f8db Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 22 Oct 2015 18:11:29 +0000 Subject: [PATCH 2/3] fix changelog OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=125 --- fcitx.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fcitx.changes b/fcitx.changes index 7dcf1bd..ad9127e 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -10,7 +10,8 @@ Thu Oct 22 14:59:29 CEST 2015 - tiwai@suse.de (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 script is also modified to check $INPUT_METHOD: + fcitx-autostart-check-INPUT_METHOD.patch * Delay start of fcitx daemon a bit, too ------------------------------------------------------------------- From 1a31c31f5fd5db229370ddc98ab6b87236d30955a041e4ab5629350c778d0e52 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 22 Oct 2015 18:12:49 +0000 Subject: [PATCH 3/3] yet another changelog fix OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=126 --- fcitx.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fcitx.changes b/fcitx.changes index ad9127e..0c4e19e 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Thu Oct 22 16:02:07 CEST 2015 - tiwai@suse.de -- Fix logging not to include the build path (boo#951602) +- 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