@@ -44,14 +44,20 @@ fi
44SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
44SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
45rm -f $SUB_SOCKET # clear socket in case we were hard shut down
45rm -f $SUB_SOCKET # clear socket in case we were hard shut down
47+# If touch session script (which sets up grid units and mir variables) is available, use it
49+if [ -x /usr/bin/ubuntu-touch-session ]; then
50+ TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
47# Normal unity8 sessions are entirely driven by Upstart. But greeters
53# Normal unity8 sessions are entirely driven by Upstart. But greeters
48# are special. They need access to the file descriptors that lightdm
54# are special. They need access to the file descriptors that lightdm
49# creates for them and don't want to start all the services that a normal
55# creates for them and don't want to start all the services that a normal
50# session would. So it's inconvenient to live within an upstart session.
56# session would. So it's inconvenient to live within an upstart session.
51# But... we still want to use Upstart for some services. So launch here.
57# But... we still want to use Upstart for some services. So launch here.
52−MIR_SOCKET=$SUB_SOCKET /sbin/init --user --startup-event=unity8-greeter-started &
58+MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/init --user --startup-event=unity8-greeter-started &
54−exec $@ --file=$SUB_SOCKET &
60+exec $TOUCH_WRAPPER $@ --file=$SUB_SOCKET &
56wait $CMD_PID
62wait $CMD_PID