Wayland
class WaylandWindowExclusivity (value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases: Enum
member NONE 1
do not reserve any space for this window
member NORMAL 2
should reserve space for this window
member AUTO 3
automatically decide whether to reserve space or not
class WaylandWindow
Bases: Window
A wayland specific window for docking purposes (works as a layer)
- Parameters:
- layer (Literal [ “background” , “bottom” , “top” , “overlay” ] | GtkLayerShell.Layer , optional) — the layer on which this window should sit on, defaults to GtkLayerShell.Layer.TOP
- anchor (str , optional) — anchor edges for this window (e.g. “top right bottom”), defaults to ""
- margin (str | Iterable *[*int ] , optional) — margen values for each edge (in the format of “top right bottom left”), defaults to “0px 0px 0px 0px”
- exclusivity (Literal [ “auto” , “normal” , “none” ] | WaylandWindowExclusivity , optional) — the way should this window reserve its surrounding space, defaults to WaylandWindowExclusivity.NONE
- keyboard_mode (Literal [ “none” , “exclusive” , “on-demand” ] | GtkLayerShell.KeyboardMode , optional) — select the way this window should handle keyboard input, defaults to GtkLayerShell.KeyboardMode.NONE
- pass_through (bool , optional) — whether to pass mouse events to the below window or not, defaults to False
- monitor (int | Gdk.Monitor | None , optional) — the monitor in which this window should be displayed at, defaults to None
- title (str , optional) — the title of this window (used for window manager scoping), defaults to “fabric”
- type (Literal [ “top-level” , “popup” ] | Gtk.WindowType , optional) — the type of this window (useful with some window managers), defaults to Gtk.WindowType.TOPLEVEL
- child (Gtk.Widget | None , optional) — a child widget to add into this window, defaults to None
- name (str | None , optional) — the name identifer for this widget (useful for styling), defaults to None
- visible (bool , optional) — whether should this widget be visible or not once initialized, defaults to True
- all_visible (bool , optional) — whether should this widget and all of its children be visible or not once initialized, defaults to False
- style (str | None , optional) — inline stylesheet to be applied on this widget, defaults to None
- style_classes (Iterable *[*str ] | str | None , optional) — a list of style classes to be added into this widget once initialized, defaults to None
- tooltip_text (str | None , optional) — the text that should be rendered inside the tooltip, defaults to None
- tooltip_markup (str | None , optional) — same as tooltip_text but it accepts simple markup expressions, defaults to None
- h_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — horizontal alignment of this widget (compared to its parent), defaults to None
- v_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — vertical alignment of this widget (compared to its parent), defaults to None
- h_expand (bool , optional) — whether should this widget fill in all the available horizontal space or not, defaults to False
- v_expand (bool , optional) — whether should this widget fill in all the available vertical space or not, defaults to False
- size (Iterable *[*int ] | int | None , optional) — a fixed size for this widget (not guranteed to get applied), defaults to None
property monitor int
This window’s current monitor
- Returns: the monitor id of this window
- Return type: int
property layer Layer
The layer in which this window sits on
- Returns: the layer type for this window
- Return type: GtkLayerShell.Layer
property anchor tuple[Edge, ...]
The list of anchor edges of this window (e.g. “top left bottom”)
- Return type: tuple[GtkLayerShell.Edge, …]
property margin tuple[int, ...]
This window’s margin (formatted as (top, right, bottom, left))
- Return type: tuple[int, …]
property keyboard_mode KeyboardMode
This window’s keybaord input mode
- Return type: GtkLayerShell.KeyboardMode
property exclusivity WaylandWindowExclusivity
Exclusivity (space reserving) mode for this window
- Return type: WaylandWindowExclusivity
property pass_through bool
Whether should this window be pass-through (pass mouse events what’s below it) or not
- Return type: bool
def steal_input () None
Ask the compositor to set this window to have the keyboard interactivity
Not guranteed to work with all Wayland compositors!
def return_input () None
Tell the compositor to remove keyboard interactivity from this window
def show (self)
def show_all (self)
static extract_anchor_values (string: str) tuple[str, ...]
Extracts the geometry values from a given geometry string.
- Parameters: string (str) — the string containing the geometry values.
- Returns: a list of unique directions extracted from the geometry string.
- Return type: list