ToplevelLayout#

class ToplevelLayout(**kwargs)#

The GdkToplevelLayout struct contains information that is necessary to present a sovereign window on screen.

The GdkToplevelLayout struct is necessary for using present.

Toplevel surfaces are sovereign windows that can be presented to the user in various states (maximized, on all workspaces, etc).

Constructors#

class ToplevelLayout
classmethod new() ToplevelLayout#

Create a toplevel layout description.

Used together with present() to describe how a toplevel surface should be placed and behave on-screen.

The size is in ”application pixels”, not ”device pixels” (see get_scale_factor()).

Methods#

class ToplevelLayout
equal(other: ToplevelLayout) bool#

Check whether layout and other has identical layout properties.

Parameters:

other – another GdkToplevelLayout

get_fullscreen() Tuple[bool, bool]#

If the layout specifies whether to the toplevel should go fullscreen, the value pointed to by fullscreen is set to True if it should go fullscreen, or False, if it should go unfullscreen.

get_fullscreen_monitor() Monitor | None#

Returns the monitor that the layout is fullscreening the surface on.

get_maximized() Tuple[bool, bool]#

If the layout specifies whether to the toplevel should go maximized, the value pointed to by maximized is set to True if it should go fullscreen, or False, if it should go unmaximized.

get_resizable() bool#

Returns whether the layout should allow the user to resize the surface.

set_fullscreen(fullscreen: bool, monitor: Monitor | None = None) None#

Sets whether the layout should cause the surface to be fullscreen when presented.

Parameters:
  • fullscreenTrue to fullscreen the surface

  • monitor – the monitor to fullscreen on

set_maximized(maximized: bool) None#

Sets whether the layout should cause the surface to be maximized when presented.

Parameters:

maximizedTrue to maximize

set_resizable(resizable: bool) None#

Sets whether the layout should allow the user to resize the surface after it has been presented.

Parameters:

resizableTrue to allow resizing