@@ -44,14 +44,20 @@ fi
4444SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
4545rm -f $SUB_SOCKET # clear socket in case we were hard shut down
4646
47+# If touch session script (which sets up grid units and mir variables) is available, use it
48+TOUCH_WRAPPER=
49+if [ -x /usr/bin/ubuntu-touch-session ]; then
50+ TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
51+fi
52+
4753# Normal unity8 sessions are entirely driven by Upstart. But greeters
4854# are special. They need access to the file descriptors that lightdm
4955# creates for them and don't want to start all the services that a normal
5056# session would. So it's inconvenient to live within an upstart session.
5157# 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 &
5359
54−exec $@ --file=$SUB_SOCKET &
60+exec $TOUCH_WRAPPER $@ --file=$SUB_SOCKET &
5561CMD_PID=$!
5662wait $CMD_PID
5763CMD_PID=