Skip to content

Gdk.ToplevelLayout

record (struct)

Contains information that is necessary to present a sovereign window on screen.

The GdkToplevelLayout struct is necessary for using Toplevel.present.

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

Constructors

new

@classmethod
def new(cls) -> ToplevelLayout

Create a toplevel layout description.

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

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

Methods

copy

def copy(self) -> ToplevelLayout

Create a new GdkToplevelLayout and copy the contents of layout into it.

equal

def equal(self, other: ToplevelLayout) -> bool

Check whether layout and other has identical layout properties.

Parameters:

  • other — another toplevel layout

get_fullscreen

def get_fullscreen(self) -> 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

def get_fullscreen_monitor(self) -> Monitor | None

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

get_maximized

def get_maximized(self) -> 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 maximized, or false, if it should go unmaximized.

get_resizable

def get_resizable(self) -> bool

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

ref

def ref(self) -> ToplevelLayout

Increases the reference count of layout.

set_fullscreen

def set_fullscreen(self, fullscreen: bool, monitor: Monitor | None = ...) -> None

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

Parameters:

  • fullscreen — true to fullscreen the surface
  • monitor — the monitor to fullscreen on

set_maximized

def set_maximized(self, maximized: bool) -> None

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

Parameters:

  • maximized — true to maximize

set_resizable

def set_resizable(self, resizable: bool) -> None

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

Parameters:

  • resizable — true to allow resizing

unref

def unref(self) -> None

Decreases the reference count of layout.