Functions

x11_device_get_id(device: X11DeviceXI2) int

Returns the device ID as seen by XInput2.

Parameters:

device – a GdkDevice

Returns:

the XInput2 device ID

x11_device_manager_lookup(device_manager: X11DeviceManagerXI2, device_id: int) X11DeviceXI2 | None

Returns the GdkDevice that wraps the given device ID.

Parameters:
  • device_manager – a GdkDeviceManager

  • device_id – a device ID, as understood by the XInput2 protocol

Returns:

The GdkDevice wrapping the device ID, or None if the given ID doesn’t currently represent a device.

x11_free_compound_text(ctext: int) None

Frees the data returned from string_to_compound_text().

Parameters:

ctext – The pointer stored in ctext from a call to string_to_compound_text().

x11_free_text_list(list: str) None

Frees the array of strings created by text_property_to_text_list().

Parameters:

list – the value stored in the list parameter by a call to text_property_to_text_list().

x11_get_server_time(surface: X11Surface) int

Routine to get the current X server time stamp.

Parameters:

surface – a GdkSurface, used for communication with the server. The surface must have GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will result.

Returns:

the time stamp

x11_get_xatom_by_name_for_display(display: X11Display, atom_name: str) int

Returns the X atom for a GdkDisplay corresponding to atom_name. This function caches the result, so if called repeatedly it is much faster than XInternAtom(), which is a round trip to the server each time.

Parameters:
  • display – a GdkDisplay

  • atom_name – a string

Returns:

a X atom for a GdkDisplay

x11_get_xatom_name_for_display(display: X11Display, xatom: int) str

Returns the name of an X atom for its display. This function is meant mainly for debugging, so for convenience, unlike XAtomName() and the result doesn’t need to be freed.

Parameters:
  • display – the GdkDisplay where xatom is defined

  • xatom – an X atom

Returns:

name of the X atom; this string is owned by GDK, so it shouldn’t be modified or freed.

x11_lookup_xdisplay(xdisplay: Display) X11Display

Find the GdkDisplay corresponding to xdisplay, if any exists.

Parameters:

xdisplay – a pointer to an X Display

Returns:

the GdkDisplay, if found, otherwise None.

x11_set_sm_client_id(sm_client_id: str | None = None) None

Sets the SM_CLIENT_ID property on the application’s leader window so that the window manager can save the application’s state using the X11R6 ICCCM session management protocol.

See the X Session Management Library documentation for more information on session management and the Inter-Client Communication Conventions Manual

Parameters:

sm_client_id – the client id assigned by the session manager when the connection was opened, or None to remove the property.