Window#

class ignis.widgets.Widget.Window(namespace: str, monitor: int | None = None, anchor: list[str] | None = None, exclusivity: str = 'normal', layer: str = 'top', kb_mode: str = 'none', popup: bool = False, margin_bottom: int = 0, margin_left: int = 0, margin_right: int = 0, margin_top: int = 0, dynamic_input_region: bool = False, **kwargs)#

Bases: Gtk.Window

The top-level widget that contains everything.

Parameters:
  • namespace (str) -- The name of the window, used to access it from the CLI and IgnisApp. It must be unique. It is also the name of the layer.

  • dynamic_input_region (bool, default: False) -- Whether to dynamically update an input region depending on the child size. See dynamic_input_region for more info.

  • **kwargs -- Properties to set.

Warning

Applying CSS styles directly to Widget.Window can cause various graphical glitches/bugs. It's highly recommended to set some container (for example, Widget.Box) or widget as a child and apply styles to it. For example:

from ignis.widgets import Widget

Widget.Window(
    namespace="some-window",
    # css_classes=['test-window'],  # don't do this!
    child=Widget.Box(
        css_classes=['test-window'],  # use this instead
        child=[...]
    )
)
Raises:

LayerShellNotSupportedError -- If the compositor does not support the Layer Shell protocol.

Widget.Window(
    namespace="example_window",
    child=Widget.Label(label='heh'),
    monitor=0,
    anchor=["top", "right"],
    exclusive=True,
    layer="top",
    kb_mode="none",
    popup=False
)
gproperty namespace: str#
  • read-only

The name of the window, used to access it from the CLI and IgnisApp.

It must be unique. It is also the name of the layer.

gproperty anchor: list[str] | None#
  • read-write

A list of anchors. If the list is empty, the window will be centered on the screen. None will unset all anchors.

Default: None.

Anchors:
  • bottom

  • left

  • right

  • top

gproperty exclusivity: str#
  • read-write

Defines how the compositor should avoid occluding a window area with other surfaces/layers.

Default: normal.

Exclusivity:
  • ignore: Completely ignore other surfaces. This allows you to overlap other surfaces.

  • normal: The window will have no extra space and do not overlap other surfaces.

  • exclusive: The compositor will reserve extra space for this window.

gproperty layer: str#
  • read-write

The layer of the surface.

Default: top.

Layer:
  • background

  • bottom

  • top

  • overlay

gproperty kb_mode: str#
  • read-write

Whether the window should receive keyboard events from the compositor.

Default: none.

Keyboard mode:
  • none: This window should not receive keyboard events.

  • exclusive: This window should have exclusive focus if it is on the top or overlay layer.

  • on_demand: The user should be able to focus and unfocus this window.

gproperty popup: bool#
  • read-write

Whether the window should close on ESC.

Works only if kb_mode is set to exclusive or on_demand.

gproperty monitor: int#
  • read-write

The monitor number on which to display the window.

Raises:

MonitorNotFoundError --

gproperty input_width: int#
  • read-write

The width at which the window can receive keyboard and mouse input. Must be > 0.

gproperty input_height: int#
  • read-write

The height at which the window can receive keyboard and mouse input. Must be > 0.

gproperty dynamic_input_region: bool#
  • read-only

Whether to dynamically update an input region depending on the child size.

child must implement child property. E.g., Widget.Box, Widget.EventBox and etc. The input region will change when child is changed.

gproperty margin_bottom: int#
  • read-write

The bottom margin.

Default: 0.

gproperty margin_left: int#
  • read-write

The left margin.

Default: 0.

gproperty margin_right: int#
  • read-write

The right margin.

Default: 0.

gproperty margin_top: int#
  • read-write

The top margin.

Default: 0.