← Back to team overview

ubuntu-phone team mailing list archive

Detecting Touch apps and X-Ubuntu-Touch

 

For the pocket desktop feature, we want to be able to distinguish between
native Touch apps and non-Touch apps, in order to be able to apply
different lifecycle policies to them.

For example, LibreOffice does not automatically save its state when it
loses focus, as a good Touch app would.  So we'd like to warn the user when
exiting pocket desktop mode that they should go save their work.

Now, whether an app was built for Touch is kind of hard to detect in
theory.  Whether it talks the Mir protocol isn't sufficient (could be a GTK
app with the Mir backend).  Whether it is a click package isn't sufficient
(some Touch apps like System Settings are debs).  At least if it is an Xmir
app instance, we know (those are all non-Touch).

Ideally, we'd have a metadata flag that indicates whether the app is
designed for Touch and thus opts-into Touch lifecycle handling (or
opts-out, depending on the default).

Thankfully, we already have a flag that looks like it might fit.  The
desktop file flag X-Ubuntu-Touch=true is already used in unity-scope-click
to (partly) determine which apps are shown in the App scope [1].  (Is it
used anywhere else?)

Is that flag suitable for repurposing to this use case?  Any objections if
I use that to determine whether an app was written for Touch or not?

(We might then need to do something to make sure that LibreOffice also
shows up in the App scope *without* setting the above flag.  But that's
manageable.)

[1]
http://bazaar.launchpad.net/~ubuntuone-control-tower/unity-scope-click/trunk/view/head:/libclickscope/click/interface.cpp#L274

-- 
-mt

Follow ups