Skip to content

Draft: GApplication: Add RestartData property, and setter

Bastien Nocera requested to merge wip/hadess/gapp-restart-data into main

The RestartData property on the org.gtk.Application interface can be used by session services to save some data to disk should the application disappear.

The application would call g_application_set_restart_data() when the state of the application changes, with enough information for the application to restart itself in the same "position".


  1. API docs
  2. note about restart data size
  3. have one example implementation of the session side

One idea would be for xdg-desktop-portal to save a stringified RestartData to ~/.var/app/$ID/config/state.gvariant if none empty when the application disappears from the bus.


  • Can we enforce to only do this for unique applications?
  • Can we detect applications leaving the bus suddenly, or do we want to rely on them clearing RestartData if they're "done" (or should they always save state, some state)
  • Should we implement this via org.gnome.SessionManager.Client and the app calling out to gnome-session instead?
  • Or is this API fine, and gnome-session can do what xdg-desktop-portal does above?
Edited by Marc-André Lureau

Merge request reports