Signal

GtkApplication::restore-window

unstable since: 4.22

Declaration

void
restore_window (
  GtkApplication* self,
  GtkRestoreReason reason,
  GVariant* state,
  gpointer user_data
)

Description [src]

Emitted when an application’s per-window state is restored.

In response to this signal, you should create a new application window, add it to application, apply the provided state, and present it. The application can use the reason to determine how much of the state should be restored.

You must be careful to be robust in the face of app upgrades and downgrades: the state might have been created by a previous or occasionally even a future version of your app. Do not assume that a given key exists in the state. Apps must try to restore state saved by a previous version, but are free to discard state if it was written by a future version.

GTK will remember which window the user was using most recently, and will emit this signal for that window first. Thus, if you decide that the provided reason means that only one window should be restored, you can reliably ignore emissions if a window already exists

Note that this signal is not emitted only during the app’s initial launch. If all windows are closed but the app keeps running, the signal will be emitted the next time a new window is opened.

Default handler:

The default handler is called before the handlers added via g_signal_connect().

Available since: 4.22

Parameters

reason

Type: GtkRestoreReason

The reason this window is restored.

state

Type: GVariant

An “a{sv}” GVariant with state to restore, as saved by a GtkApplicationWindow::save-state handler.

The data is owned by the caller of the function.