Signal
GtkApplication::restore-window
unstable since: 4.24
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
This signal will be emitted whenever the application needs to restore its windows. This normally happens during the initial launch, but it can also happen in the existing application instance if it is re-activated after all application windows were closed.
| Default handler: The default handler is called before the handlers added via |
| Available since: 4.24 |
Parameters
reason-
Type:
GtkRestoreReasonThe reason this window is restored.
state-
Type:
GVariantAn
a{sv}dictionary containing the state to restore, as saved by aGtkApplicationWindow::save-statehandler.The data is owned by the caller of the function.