I don't have a device to test this on, but after looking a bit more, you're right. There are two different sessions, one is ubuntu-touch-session (sets it to 'ubuntu-touch'), the other is unity8-desktop-session-mir (sets it to 'unity8-mir'). These values are set by lightdm, which looks up the user-session values from /usr/share/lightdm/lightdm.conf.d/52-ubuntu-touch.conf (from the ubuntu-touch-session package) and /usr/share/lightdm/lightdm.conf.d/55-unity8.conf (from the unity8-desktop-session-mir package) respectively.
So I guess the solution is to add ubuntu-touch as a possible match for XDG_SESSION_DESKTOP. TBH, I'm extremely surprised it worked on the device initially...
I don't have a device to test this on, but after looking a bit more, you're right. There are two different sessions, one is ubuntu- touch-session (sets it to 'ubuntu-touch'), the other is unity8- desktop- session- mir (sets it to 'unity8-mir'). These values are set by lightdm, which looks up the user-session values from /usr/share/ lightdm/ lightdm. conf.d/ 52-ubuntu- touch.conf (from the ubuntu- touch-session package) and /usr/share/ lightdm/ lightdm. conf.d/ 55-unity8. conf (from the unity8- desktop- session- mir package) respectively.
So I guess the solution is to add ubuntu-touch as a possible match for XDG_SESSION_ DESKTOP. TBH, I'm extremely surprised it worked on the device initially...