:right-sidebar: True X11Display =================================================================== .. currentmodule:: gi.repository.GdkX11 .. class:: X11Display(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gdk.Display`, :class:`~gi.repository.GObject.Object` :Constructors: :: X11Display(**properties) Methods ------- .. rst-class:: interim-class .. class:: X11Display :no-index: .. method:: error_trap_pop() -> int Pops the error trap pushed by :func:`~gi.repository.GdkX11.X11Display.error_trap_push`. Will XSync() if necessary and will always block until the error is known to have occurred or not occurred, so the error code can be returned. If you don’t need to use the return value, :func:`~gi.repository.GdkX11.X11Display.error_trap_pop_ignored` would be more efficient. .. method:: error_trap_pop_ignored() -> None Pops the error trap pushed by :func:`~gi.repository.GdkX11.X11Display.error_trap_push`. Does not block to see if an error occurred; merely records the range of requests to ignore errors for, and ignores those errors if they arrive asynchronously. .. method:: error_trap_push() -> None Begins a range of X requests on ``display`` for which X error events will be ignored. Unignored errors (when no trap is pushed) will abort the application. Use :func:`~gi.repository.GdkX11.X11Display.error_trap_pop` or :func:`~gi.repository.GdkX11.X11Display.error_trap_pop_ignored`to lift a trap pushed with this function. .. method:: get_default_group() -> ~gi.repository.Gdk.Surface Returns the default group leader surface for all toplevel surfaces on ``display``\. This surface is implicitly created by GDK. See :func:`~gi.repository.GdkX11.X11Surface.set_group`. .. method:: get_egl_display() -> ~typing.Any | None Retrieves the EGL display connection object for the given GDK display. This function returns ``NULL`` if GDK is using GLX. .. versionadded:: 4.4 .. method:: get_egl_version() -> ~typing.Tuple[bool, int, int] Retrieves the version of the EGL implementation. .. versionadded:: 4.4 .. method:: get_glx_version() -> ~typing.Tuple[bool, int, int] Retrieves the version of the GLX implementation. .. method:: get_primary_monitor() -> ~gi.repository.Gdk.Monitor Gets the primary monitor for the display. The primary monitor is considered the monitor where the “main desktop” lives. While normal application surfaces typically allow the window manager to place the surfaces, specialized desktop applications such as panels should place themselves on the primary monitor. If no monitor is the designated primary monitor, any monitor (usually the first) may be returned. .. method:: get_screen() -> ~gi.repository.GdkX11.X11Screen Retrieves the ``GdkX11Screen`` of the ``display``\. .. method:: get_startup_notification_id() -> str Gets the startup notification ID for a display. .. deprecated:: 4.10 Please do not use it in newly written code .. method:: get_user_time() -> int Returns the timestamp of the last user interaction on ``display``\. The timestamp is taken from events caused by user interaction such as key presses or pointer movements. See :func:`~gi.repository.GdkX11.X11Surface.set_user_time`. .. method:: get_xcursor(cursor: ~gi.repository.Gdk.Cursor) -> int Returns the X cursor belonging to a ``GdkCursor``\, potentially creating the cursor. Be aware that the returned cursor may not be unique to ``cursor``\. It may for example be shared with its fallback cursor. On old X servers that don't support the XCursor extension, all cursors may even fall back to a few default cursors. :param cursor: a ``GdkCursor`` .. method:: get_xdisplay() -> ~gi.repository.xlib.Display Returns the X display of a ``GdkDisplay``\. .. method:: get_xrootwindow() -> int Returns the root X window used by ``GdkDisplay``\. .. method:: get_xscreen() -> ~gi.repository.xlib.Screen Returns the X Screen used by ``GdkDisplay``\. .. method:: grab() -> None Call XGrabServer() on ``display``\. To ungrab the display again, use :func:`~gi.repository.GdkX11.X11Display.ungrab`. :func:`~gi.repository.GdkX11.X11Display.grab`/:func:`~gi.repository.GdkX11.X11Display.ungrab` calls can be nested. .. classmethod:: open() -> ~gi.repository.Gdk.Display | None Tries to open a new display to the X server given by ``display_name``\. If opening the display fails, :const:`None` is returned. .. method:: set_cursor_theme(theme: str | None, size: int) -> None Sets the cursor theme from which the images for cursor should be taken. If the windowing system supports it, existing cursors created with :obj:`~gi.repository.Gdk.Cursor.new_from_name` are updated to reflect the theme change. Custom cursors constructed with :obj:`~gi.repository.Gdk.Cursor.new_from_texture` will have to be handled by the application (GTK applications can learn about cursor theme changes by listening for change notification for the corresponding ``GtkSetting``\). .. deprecated:: 4.16 Use the cursor-related properties of `GtkSettings <../gtk4/class.Settings.html>`__ to set the cursor theme :param theme: the name of the cursor theme to use, or :const:`None` to unset a previously set value :param size: the cursor size to use, or 0 to keep the previous size .. classmethod:: set_program_class(program_class: str) -> None Sets the program class. The X11 backend uses the program class to set the class name part of the ``WM_CLASS`` property on toplevel windows; see the ICCCM. :param program_class: a string .. method:: set_startup_notification_id(startup_id: str) -> None Sets the startup notification ID for a display. This is usually taken from the value of the DESKTOP_STARTUP_ID environment variable, but in some cases (such as the application not being launched using exec()) it can come from other sources. If the ID contains the string "_TIME" then the portion following that string is taken to be the X11 timestamp of the event that triggered the application to be launched and the GDK current event time is set accordingly. The startup ID is also what is used to signal that the startup is complete (for example, when opening a window or when calling :func:`~gi.repository.Gdk.Gdk.Display.notify_startup_complete`). .. deprecated:: 4.10 Using :obj:`~gi.repository.Gdk.Toplevel.set_startup_id` is sufficient :param startup_id: the startup notification ID (must be valid utf8) .. method:: set_surface_scale(scale: int) -> None Forces a specific window scale for all windows on this display, instead of using the default or user configured scale. This is can be used to disable scaling support by setting ``scale`` to 1, or to programmatically set the window scale. Once the scale is set by this call it will not change in response to later user configuration changes. :param scale: The new scale value .. method:: string_to_compound_text(str: str) -> ~typing.Tuple[int, str, int, list[int]] Convert a string from the encoding of the current locale into a form suitable for storing in a window property. :param str: a nul-terminated string .. method:: text_property_to_text_list(encoding: str, format: int, text: int, length: int, list: str) -> int Convert a text string from the encoding as it is stored in a property into an array of strings in the encoding of the current locale. (The elements of the array represent the nul-separated elements of the original text string.) :param encoding: a string representing the encoding. The most common values for this are "STRING", or "COMPOUND_TEXT". This is value used as the type for the property :param format: the format of the property :param text: The text data :param length: The number of items to transform :param list: location to store an array of strings in the encoding of the current locale. This array should be freed using :func:`~gi.repository.GdkX11.x11_free_text_list`. .. method:: ungrab() -> None Ungrab ``display`` after it has been grabbed with :func:`~gi.repository.GdkX11.X11Display.grab`. .. method:: utf8_to_compound_text(str: str) -> ~typing.Tuple[bool, str, int, list[int]] Converts from UTF-8 to compound text. :param str: a UTF-8 string Signals ------- .. rst-class:: interim-class .. class:: X11Display.signals :no-index: .. method:: xevent(xevent: ~typing.Any = None) -> bool The type of the None singleton. :param xevent: a pointer to the XEvent to process