Comment 8 for bug 1720250

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

Fist of all, I don't know details about history of upstart/unity
and user session system. There is no conclusion, just my research.

---

For Unity8/Mir, upstart script of im-config was added LP #1433831
This Ubuntu only script should be removed from im-config package.

Since switching user session from upstart to systemd, above upstart script
is convert to systemd unit on 0.29-1ubuntu14.

However this unit file uses initctl command, then this unit work on both of
systemd and upstart installed system only.

Legacy (Xorg) system will launches /etc/X11/Xsession.d/70im-config_launch
and set STARTUP variable to exec /usr/bin/im-launch.
All environment variables are set, no problem.

Wayland system doesn't exec /etc/X11/Xsession.d, i.e. any mechanism to
set environment variables is needed as like on Unity8/Mir.

(old) systemd unit doesn't work by two reasons.

  1. use initctl command of upstart
  2. bind to graphical-session.target which is not launched on ubuntu

If I understand correctly, graphical-session.target and graphical-session-pre.target
will be launched for unity8 system and others.
At artful, this target are not depended by any target and service.

/usr/lib/gnome-session/run-systemd-session will stop these targets,
but this script will be executed from unity.desktop only.

How about use basic.target instead of graphical-session.target?
I attach sample im-config.service.

sudo cp im-config.service /usr/lib/systemd/user/
systemctl --user daemon-reload
systemctl --user enable im-config.service
(and restart session by logout and login)

This service file will work about environment variables.

$ env | grep -E '_IM|XMOD'
CLUTTER_IM_MODULE=xim
QT4_IM_MODULE=xim
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
GTK_IM_MODULE=ibus

However suggestion window will be displayed on top left of display,
not near cursor on gedit and gnome-termial. The reason isn't known.