GdkX11.X11Display¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Class Details¶
- class GdkX11.X11Display(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod open(display_name)[source]¶
- Parameters:
display_name (
str
orNone
) – name of the X display. See thexlib.open_display
() for details.- Returns:
The new display
- Return type:
Gdk.Display
orNone
Tries to open a new display to the X server given by display_name. If opening the display fails,
None
is returned.
- classmethod set_program_class(display, program_class)[source]¶
- Parameters:
display (
Gdk.Display
) – aGdkDisplay
program_class (
str
) – a string
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.
- error_trap_pop()[source]¶
- Returns:
X error code or 0 on success
- Return type:
Pops the error trap pushed by
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,
GdkX11.X11Display.error_trap_pop_ignored
() would be more efficient.
- error_trap_pop_ignored()[source]¶
Pops the error trap pushed by
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.
- error_trap_push()[source]¶
Begins a range of X requests on self for which X error events will be ignored. Unignored errors (when no trap is pushed) will abort the application. Use
GdkX11.X11Display.error_trap_pop
() orGdkX11.X11Display.error_trap_pop_ignored
()to lift a trap pushed with this function.
- get_default_group()[source]¶
- Returns:
The default group leader surface for self
- Return type:
Returns the default group leader surface for all toplevel surfaces on self. This surface is implicitly created by GDK. See
GdkX11.X11Surface.set_group
().
- get_egl_display()[source]¶
-
Retrieves the EGL display connection object for the given GDK display.
This function returns
NULL
if GDK is using GLX.New in version 4.4.
- get_egl_version()[source]¶
- Returns:
True
if EGL is available- major:
return location for the EGL major version
- minor:
return location for the EGL minor version
- Return type:
Retrieves the version of the EGL implementation.
New in version 4.4.
- get_glx_version()[source]¶
- Returns:
True
if GLX is available- major:
return location for the GLX major version
- minor:
return location for the GLX minor version
- Return type:
Retrieves the version of the GLX implementation.
- get_primary_monitor()[source]¶
- Returns:
the primary monitor, or any monitor if no primary monitor is configured by the user
- Return type:
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.
- get_screen()[source]¶
- Returns:
the
GdkX11Screen
- Return type:
Retrieves the
GdkX11Screen
of the self.
- get_startup_notification_id()[source]¶
- Returns:
the startup notification ID for self
- Return type:
Gets the startup notification ID for a display.
Deprecated since version 4.10.
- get_user_time()[source]¶
- Returns:
the timestamp of the last user interaction
- Return type:
Returns the timestamp of the last user interaction on self. The timestamp is taken from events caused by user interaction such as key presses or pointer movements. See
GdkX11.X11Surface.set_user_time
().
- get_xcursor(cursor)[source]¶
- Parameters:
cursor (
Gdk.Cursor
) – aGdkCursor
- Returns:
an Xlib Cursor.
- Return type:
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.
- get_xrootwindow()[source]¶
- Returns:
an X Window
- Return type:
Returns the root X window used by
GdkDisplay
.
- get_xscreen()[source]¶
- Returns:
an X
xlib.Screen
- Return type:
Returns the X
xlib.Screen
used byGdkDisplay
.
- grab()[source]¶
Call XGrabServer() on self. To ungrab the display again, use
GdkX11.X11Display.ungrab
().GdkX11.X11Display.grab
()/GdkX11.X11Display.ungrab
() calls can be nested.
- set_cursor_theme(theme, size)[source]¶
- Parameters:
Sets the cursor theme from which the images for cursor should be taken.
If the windowing system supports it, existing cursors created with [ctor`Gdk`.Cursor.new_from_name] are updated to reflect the theme change. Custom cursors constructed with [ctor`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
).
- set_startup_notification_id(startup_id)[source]¶
- Parameters:
startup_id (
str
) – the startup notification ID (must be valid utf8)
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
Gdk.Display.notify_startup_complete
()).Deprecated since version 4.10: Using [method`Gdk`.Toplevel.set_startup_id] is sufficient
- set_surface_scale(scale)[source]¶
- Parameters:
scale (
int
) – The new scale value
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.
- string_to_compound_text(str)[source]¶
- Parameters:
str (
str
) – a nul-terminated string- Returns:
0 upon success, non-zero upon failure
- encoding:
location to store the encoding (to be used as the type for the property)
- format:
location to store the format of the property
- ctext:
location to store newly allocated data for the property
- Return type:
Convert a string from the encoding of the current locale into a form suitable for storing in a window property.
- text_property_to_text_list(encoding, format, text, length, list)[source]¶
- Parameters:
encoding (
str
) – 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 propertyformat (
int
) – the format of the propertytext (
int
) – The text datalength (
int
) – The number of items to transformlist (
str
) – location to store an array of strings in the encoding of the current locale. This array should be freed usingGdkX11.x11_free_text_list
().
- Returns:
the number of strings stored in list, or 0, if the conversion failed
- Return type:
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.)
- ungrab()[source]¶
Ungrab self after it has been grabbed with
GdkX11.X11Display.grab
().
- utf8_to_compound_text(str)[source]¶
- Parameters:
str (
str
) – a UTF-8 string- Returns:
True
if the conversion succeeded, otherwiseFalse
- encoding:
location to store resulting encoding
- format:
location to store format of the result
- ctext:
location to store the data of the result
- Return type:
Converts from UTF-8 to compound text.
Signal Details¶
- GdkX11.X11Display.signals.xevent(x11_display, xevent)¶
- Signal Name:
xevent
- Flags:
- Parameters:
x11_display (
GdkX11.X11Display
) – The object which received the signalxevent (
object
orNone
) – a pointer to thexlib.XEvent
to process
- Returns:
True
to stop other handlers from being invoked for the event.False
to propagate the event further.- Return type:
The
::xevent
signal is a low level signal that is emitted whenever anxlib.XEvent
has been received.When handlers to this signal return
True
, no other handlers will be invoked. In particular, the default handler for this function is GDK’s own event handling mechanism, so by returningTrue
for an event that GDK expects to translate, you may break GDK and/or GTK+ in interesting ways. You have been warned.If you want this signal handler to queue a
GdkEvent
, you can useGdk.Display.put_event
().If you are interested in X GenericEvents, bear in mind that XGetEventData() has been already called on the event, and XFreeEventData() will be called afterwards.