Package: gtk

Accessor gtk-window-role

Lambda List

gtk-window-role (object)

Syntax

(gtk-window-role object) => role
(setf (gtk-window-role object) role)

Arguments

object -- a gtk-window widget
role -- a string with an unique identifier for the window to be used when restoring a session

Details

Accessor of the role slot of the gtk-window class.

The gtk-window-role slot access function returns the role of the window if set, or nil. The (setf gtk-window-role) slot access function sets an unique identifier for the window to be used when restoring a session. This function is only useful on X11, not with other GTK targets.

In combination with the window title, the window role allows a window manager to identify "the same" window when an application is restarted. So for example you might set the "toolbox" role on the toolbox window of the application, so that when the user restarts the session, the window manager can put the toolbox back in the same place.

If a window already has a unique title, you do not need to set the role, since the window manager can use the title to identify the window when restoring the session.
 

See also

2021-9-9