Accepting request 362444 from home:tiwai:branches:M17N

(Resubmission with NoDisplay=true in autostart.desktop)

- Fix the invocation of ibus service for KDE, etc (boo#968486):
  for DEs known to support autostart (KDE, XFCE and LXCE), ibus is
  now started via XDG autostart for avoiding the race.  This should
  fix the missing ibus service.  For other DEs, ibus is still
  started in xim script, but with a slight (two seconds) delay for
  avoiding the race, too.
  Along with the change, INPUT_METHOD environment variable is set
  explicitly in xim script at startup; this is referred in XDG
  autostart so that it won't be executed when other IM is chosen.
  Last but not least, the explicit dbus-launch invocation is dropped,
  as it's known to conflict with DE's own startup of dbus

OBS-URL: https://build.opensuse.org/request/show/362444
OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=146
This commit is contained in:
Fuminobu Takeyama 2016-02-28 16:32:13 +00:00 committed by Git OBS Bridge
parent 066f1fced6
commit b7af184101
5 changed files with 69 additions and 13 deletions

15
ibus-autostart Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
test x"$INPUT_METHOD" = x"ibus" || exit 0
# GNOME starts ibus by itself
case "$WINDOWMANAGER" in
*gnome*)
exit 0;;
esac
# sleep for a little while to avoid duplicate startup
# sleep 2
ibus-daemon --xim -d
exit 0

16
ibus-autostart.desktop Normal file
View File

@ -0,0 +1,16 @@
[Desktop Entry]
_Name=IBus
_GenericName=IBus Daemon
_Comment=Start IBus daemon
Exec=ibus-autostart
Icon=ibus-setup
Terminal=false
Type=Application
Categories=System;Utility;
StartupNotify=false
NoDisplay=true
X-GNOME-Autostart-Phase=Applications
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Notify=false
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Wed Feb 24 19:01:08 CET 2016 - tiwai@suse.de
- Fix the invocation of ibus service for KDE, etc (boo#968486):
for DEs known to support autostart (KDE, XFCE and LXCE), ibus is
now started via XDG autostart for avoiding the race. This should
fix the missing ibus service. For other DEs, ibus is still
started in xim script, but with a slight (two seconds) delay for
avoiding the race, too.
Along with the change, INPUT_METHOD environment variable is set
explicitly in xim script at startup; this is referred in XDG
autostart so that it won't be executed when other IM is chosen.
Last but not least, the explicit dbus-launch invocation is dropped,
as it's known to conflict with DE's own startup of dbus
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 10 05:03:43 UTC 2015 - ftake@geeko.jp Mon Aug 10 05:03:43 UTC 2015 - ftake@geeko.jp

View File

@ -1,7 +1,7 @@
# #
# spec file for package ibus # spec file for package ibus
# #
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -44,6 +44,8 @@ Source4: xim.d-ibus-121
Source5: kde.tar.gz Source5: kde.tar.gz
Source6: kde-12.2.tar.gz Source6: kde-12.2.tar.gz
Source7: macros.ibus Source7: macros.ibus
Source10: ibus-autostart
Source11: ibus-autostart.desktop
Source99: baselibs.conf Source99: baselibs.conf
# PATCH-FIX-OPENSUSE ibus-python-install-dir.patch ftake@geeko.jp # PATCH-FIX-OPENSUSE ibus-python-install-dir.patch ftake@geeko.jp
Patch0: ibus-python-install-dir.patch Patch0: ibus-python-install-dir.patch
@ -280,6 +282,10 @@ make DESTDIR=%{buildroot} install -j1
# autostart # autostart
mkdir -p %{buildroot}%{_sysconfdir}/X11/xim.d/ mkdir -p %{buildroot}%{_sysconfdir}/X11/xim.d/
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/X11/xim.d/ibus install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/X11/xim.d/ibus
mkdir -p %{buildroot}%{_bindir}
install -c -m 0755 %{SOURCE10} %{buildroot}%{_bindir}/ibus-autostart
mkdir -p %{buildroot}%{_sysconfdir}/xdg/autostart
install -c -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/xdg/autostart/ibus-autostart.desktop
sed -i 1i"SYS_LIB=%{_lib}" %{buildroot}%{_sysconfdir}/X11/xim.d/ibus sed -i 1i"SYS_LIB=%{_lib}" %{buildroot}%{_sysconfdir}/X11/xim.d/ibus
@ -365,6 +371,7 @@ dconf update
%config %{_sysconfdir}/rpm/macros.ibus %config %{_sysconfdir}/rpm/macros.ibus
%config %{_sysconfdir}/X11/xim.d/* %config %{_sysconfdir}/X11/xim.d/*
%{_bindir}/ibus %{_bindir}/ibus
%{_bindir}/ibus-autostart
%{_bindir}/ibus-daemon %{_bindir}/ibus-daemon
%{_bindir}/ibus-setup %{_bindir}/ibus-setup
%{_datadir}/ibus/ %{_datadir}/ibus/
@ -381,6 +388,7 @@ dconf update
# This file is not a config file. Users may not modify it. # This file is not a config file. Users may not modify it.
%{_sysconfdir}/dconf/db/ibus.d/00-upstream-settings %{_sysconfdir}/dconf/db/ibus.d/00-upstream-settings
%{_sysconfdir}/dconf/profile/ibus %{_sysconfdir}/dconf/profile/ibus
%{_sysconfdir}/xdg/autostart/ibus-autostart.desktop
%{_mandir}/man1/ibus.1.gz %{_mandir}/man1/ibus.1.gz
%{_mandir}/man1/ibus-daemon.1.gz %{_mandir}/man1/ibus-daemon.1.gz
%{_mandir}/man1/ibus-setup.1.gz %{_mandir}/man1/ibus-setup.1.gz

View File

@ -3,11 +3,10 @@ if ! type ibus-daemon > /dev/null 2>&1 ; then
return 1 return 1
fi fi
# explicitly set below, as referred in xdg autostart
export INPUT_METHOD=ibus
case "$WINDOWMANAGER" in case "$WINDOWMANAGER" in
#when skim installed, Autostart must be "false".
#here we move $HOME/.kde/share/config/skimrc to skimrc.orig.ibus
*kde*)
;;
# GNOME 3 Settings Daemon keyboard plugin manages all ibus settings itself, # GNOME 3 Settings Daemon keyboard plugin manages all ibus settings itself,
# so don't do manual setup&startup of ibus otherwise it would conflict with # so don't do manual setup&startup of ibus otherwise it would conflict with
# G-S-D. see bnc#873016. # G-S-D. see bnc#873016.
@ -29,9 +28,6 @@ case "$WINDOWMANAGER" in
gsettings set org.gnome.settings-daemon.plugins.keyboard active true gsettings set org.gnome.settings-daemon.plugins.keyboard active true
return 0 return 0
;; ;;
*)
# do nothing
;;
esac esac
# Force OOo to use gtk-immodule # Force OOo to use gtk-immodule
@ -56,11 +52,15 @@ else
export QT_IM_MODULE=xim export QT_IM_MODULE=xim
fi fi
if [ -z $DBUS_SESSION_BUS_ADDRESS ]; then case "$WINDOWMANAGER" in
eval `dbus-launch --sh-syntax --exit-with-session --close-stderr < /dev/null` *kde*|*xfce*|*lxde*)
fi # started via xdg autostart
;;
ibus-daemon --xim -d *)
# FIXME: a little bit of delay is required to avoid race
(sleep 2; ibus-daemon --xim -d) &
;;
esac
# success: # success:
return 0 return 0