← Back to team overview

unity-design team mailing list archive

Re: Are there plans to add "Reboot" item to the power-cog menu in panel?

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Shuttleworth wrote on 29/02/12 07:53:
> 
> On 28/02/12 18:54, Matthew Paul Thomas wrote:
>> 
>> The story of nick rundy's parents is an awkward one. But the only
>> way to be sure that an Ubuntu, Mac, or Windows PC will log out or
>> shut down safely is to wait a few seconds to answer any questions
>> it asks after you choose that command. Developing and universally
>> adopting a standard auto-save API, so that users never need to
>> save documents manually, might solve much of that problem.
>> Changing the design of the shutdown dialog would not.
> 
> We could, however, design the API and give developers one cycle to 
> adopt it before making that behaviour the default. Updating the 
> shutdown dialog to JFDI would make apps that don't support the API 
> buggy.


Then every Ubuntu app would be buggy indefinitely. Gnome had
rudimentary session saving/restore APIs for years, they were never
adopted reliably, and several default Ubuntu applications were never
Gnome ones anyway. So Didier Roche finally put the feature out of its
misery in Ubuntu 11.10.
<https://lists.ubuntu.com/archives/ubuntu-desktop/2011-January/002734.html>

At exactly the same time, OS X 10.7 introduced its Resume function for
applications to save and restore state. So, how might we overcome our
previous failure and catch up to Apple?

First, OS X had a mature document-handling API (NSDocument) that many,
if not most, multi-window applications were using already. "For a
multiwindow app based on NSDocument", their docs explain, "automatic
saving is as simple as overriding the autosavesInPlace class method to
return YES." Our nearest equivalent is GApplication and
GtkApplication, but most of it is new in GTK 3.4 -- and, oh dear, the
session handling feature has "Default value: FALSE".
<http://developer.gnome.org/gtk3/unstable/GtkApplication.html#GtkApplication--register-session>
Developing an equivalent to NSDocument would help solve many other
problems and inconsistencies, not just this one.

Second, OS X had a mature database API (Core Data) that allowed easy
saving of interface state, undo/redo stacks, and so on. We had, oh
dear, desktopcouch.
<https://lists.ubuntu.com/archives/ubuntu-desktop/2011-November/003474.html>

Third, Apple provided copious documentation on how to implement the
Resume feature. Since late 2011 we have a part-time writer for
developer.ubuntu.com, so that part we could tackle most easily.

Fourth, Apple needed to provide all this for only a single toolkit,
Cocoa. We have not one but *four* toolkits merely for the applications
we ship by default. (Which is why, for example, we had to develop five
menu export plugins -- including Firefox and Thunderbird separately --
instead of one.) As long as we don't replace those applications not
using our preferred toolkit, we'll be at a competitive disadvantage
when developing any cross-application features.

And fifth, because Apple were developing so many of their own base
applications, they could ensure that Resume was implemented in a
critical mass of applications -- Safari, Mail, iCal, Contacts, Pages,
Keynote, Numbers, even lowly TextEdit. On our side, Firefox alone has
pretty good session saving. It would be an uphill battle getting
developers of any of our other default applications -- even, or
perhaps especially, the Gnome ones -- to adopt any APIs that we led on.

- -- 
mpt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9OcXUACgkQ6PUxNfU6ecqiiwCfUT/UWoQKvaqm7Md0QLjDXrMx
gYIAn1wNTmWGxSzDPMaoW++HRWM69Vmk
=VA2Q
-----END PGP SIGNATURE-----


Follow ups

References