QX11Info

Provides information about the X display configuration. More

Inheritance diagram of PySide2.QtX11Extras.QX11Info

Synopsis

Static functions

Detailed Description

The class provides two APIs: a set of non-static functions that provide information about a specific widget or pixmap, and a set of static functions that provide the default information for the application.

Warning

This class is only available on X11. For querying per-screen information in a portable way, use QDesktopWidget .

class PySide2.QtX11Extras.QX11Info
PySide2.QtX11Extras.QX11Info.PeekOption

An enum to tune the behavior of peekEventQueue() .

Constant

Description

QX11Info.PeekDefault

Peek from the beginning of the buffered native event queue. A peeker id is optional with . If a peeker id is provided to peekEventQueue() when using , then peeking starts from the beginning of the queue, not from the cached index; thus, this can be used to manually reset a cached index to peek from the start of the queue. When this operation completes, the associated index will be updated to the new position in the queue.

QX11Info.PeekFromCachedIndex

peekEventQueue() can optimize the peeking algorithm by skipping events that it already has seen in earlier calls to peekEventQueue() . When control returns to the main event loop, which causes the buffered native event queue to be flushed to Qt’s event queue, the cached indices are marked invalid and will be reset on the next access. The same is true if the program explicitly flushes the buffered native event queue by processEvents() .

New in version 5.10.

static PySide2.QtX11Extras.QX11Info.appDpiX([screen=-1])
Parameters

screen – int

Return type

int

Returns the horizontal resolution of the given screen in terms of the number of dots per inch.

The screen argument is an X screen number. Be aware that if the user’s system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.

See also

appDpiY()

static PySide2.QtX11Extras.QX11Info.appDpiY([screen=-1])
Parameters

screen – int

Return type

int

Returns the vertical resolution of the given screen in terms of the number of dots per inch.

The screen argument is an X screen number. Be aware that if the user’s system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.

See also

appDpiX()

static PySide2.QtX11Extras.QX11Info.appRootWindow([screen=-1])
Parameters

screen – int

Return type

int

Returns a handle for the applications root window on the given screen .

The screen argument is an X screen number. Be aware that if the user’s system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.

See also

desktop()

static PySide2.QtX11Extras.QX11Info.appScreen()
Return type

int

Returns the number of the screen where the application is being displayed.

This method refers to screens in the original X11 meaning with a different DISPLAY environment variable per screen. This information is only useful if your application needs to know on which X screen it is running.

In a typical multi-head configuration, multiple physical monitors are combined in one X11 screen. This means this method returns the same number for each of the physical monitors. In such a setup you are interested in the monitor information as provided by the X11 RandR extension. This is available through QDesktopWidget and QScreen .

See also

display()

static PySide2.QtX11Extras.QX11Info.appTime()
Return type

int

Returns the X11 time.

static PySide2.QtX11Extras.QX11Info.appUserTime()
Return type

int

Returns the X11 user time.

static PySide2.QtX11Extras.QX11Info.generatePeekerId()
Return type

qint32

Returns a new peeker id or -1 if some interal error has occurred. Each peeker id is associated with an index in the buffered native event queue.

For more details see PeekOption and peekEventQueue() .

See also

peekEventQueue() removePeekerId()

static PySide2.QtX11Extras.QX11Info.getTimestamp()
Return type

int

Fetches the current X11 time stamp from the X Server.

This method creates a property notify event and blocks till it is received back from the X Server.

static PySide2.QtX11Extras.QX11Info.isCompositingManagerRunning([screen=-1])
Parameters

screen – int

Return type

bool

Returns true if there is a compositing manager running for the connection attached to screen .

If screen equals -1, the application’s primary screen is used.

static PySide2.QtX11Extras.QX11Info.isPlatformX11()
Return type

bool

Returns true if the application is currently running on X11.

static PySide2.QtX11Extras.QX11Info.nextStartupId()
Return type

PySide2.QtCore.QByteArray

Returns the startup ID that will be used for the next window to be shown by this process.

After the next window is shown, the next startup ID will be empty.

http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt

static PySide2.QtX11Extras.QX11Info.removePeekerId(peekerId)
Parameters

peekerIdqint32

Return type

bool

Removes peekerId , which was earlier obtained via generatePeekerId() .

Returns true on success or false if unknown peeker id was provided or some interal error has occurred.

static PySide2.QtX11Extras.QX11Info.setAppTime(time)
Parameters

time – int

Sets the X11 time to the value specified by time .

static PySide2.QtX11Extras.QX11Info.setAppUserTime(time)
Parameters

time – int

Sets the X11 user time as specified by time .

static PySide2.QtX11Extras.QX11Info.setNextStartupId(id)
Parameters

idPySide2.QtCore.QByteArray

Sets the next startup ID to id .

This is the startup ID that will be used for the next window to be shown by this process.

The startup ID of the first window comes from the environment variable DESKTOP_STARTUP_ID. This method is useful for subsequent windows, when the request comes from another process (e.g. via DBus).

See also

nextStartupId()