[Interest] Window ID of the current screen (root window)?

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Fri Nov 20 15:06:00 CET 2020



On 20 Nov 2020, at 14:55, Richard Moore <rich at kde.org<mailto:rich at kde.org>> wrote:



On Fri, 20 Nov 2020 at 07:58, Volker Hilsheimer <volker.hilsheimer at qt.io<mailto:volker.hilsheimer at qt.io>> wrote:
In Qt 6 there is no more Qt API to get the X11 root window for a display (also note that QDesktopWidget as a whole is gone).

So, you either have to go native if you rely on X11 specific data structures (which the code does anyway, in verifying that there is a DISPLAY environment variable), or pass a pointer to (or index of) a QScreen if you want to place a UI on a specific display.

I'd hope there's a way to get the actual connection being used, rather than relying on looking at the environment variables. For example, what happens if -display is passed?

Not at the moment, as XCB doesn’t expose that. Xlib does, but only if the connection was created using Xlib. An API to expose whatever Qt decides to use based on parsing DISPLAY or -display, like we have in QX11Extras, is being considered, but won’t be in 6.0. Ideally XCB would expose this, so we don’t need to add workarounds in Qt.

Cheers,
Tor Arne

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20201120/9c5f2ea1/attachment.html>


More information about the Interest mailing list