summaryrefslogtreecommitdiff
path: root/src/x11extras/qx11info_x11.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add QX11Info::peekEventQueue() APIv5.10.0-beta3v5.10.0-beta2v5.10.0-beta1v5.10.0-alpha1Gatis Paeglis2017-08-291-0/+158
| | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QX11Info] Added new API to peek into the XCB event queue - peekEventQueue(). This enables porting certain Qt4-based applications to Qt5 (those using Xlib's event handling functions to peek into the X11 event queue). In Qt5 we set XCB to be the owner of the X11 event queue with XSetEventQueueOwner(dpy, XCBOwnsEventQueue), which means that only XCB event handling functions can be used to read events from the X server. XCB does not have an equivalent for Xlib's peeker API. For filtering out unwanted native events Qt5 provides QAbstractNativeEventFilter::nativeEventFilter(), but there isn't any API in Qt to just *peek* into the queue while the GUI thread is busy processing a long task. The peekEventQueue() function adds this capability via QX11Info. Manual and auto test included. Task-number: QTBUG-50358 Change-Id: Id31f797f7ff76d011ad7a55a9b6c13756aaaca60 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Eradicate last Q_FOREACH and mark the library as Q_FOREACH-free and ↵v5.8.0-beta1Marc Mutz2016-09-231-1/+2
| | | | | | | | | | | | | | warning_clean The only public header, qx11info_x11.h isn't actually recognized by headersclean as a public header, so warning_clean has no effect. But the header _is_ clean, and maybe headersclean in QtBase will be fixed at some point. Change-Id: I23ef8476bee111685d7261322b4f7af47498dc96 Reviewed-by: Gabriel Hege <hege@daviko.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Revert "Add missing qdebug.h include"Nikita Krupenko2016-05-171-1/+0
| | | | | | | | This reverts commit ef878e7f30d3c407adafc62166adc86b1658f7f2. Required include already added in 4fd9c8527cfb5c5942712393b3577c0ed6405dc2. Change-Id: Iabc0bd42788151e922bdd8157a09ab8b43abcb54 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Add missing qdebug.h includeNikita Krupenko2016-05-171-0/+1
| | | | | Change-Id: I081b597eedad6ea90afcfd53c0497fe941f3168d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QX11Info: Add missing includeGabriel de Dietrich2016-05-171-0/+1
| | | | | Change-Id: Ie1a54eaf5b450ea638766035cdaaf50750e6de50 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix documentation of QX11Info::isCompositingManagerRunning().v5.7.0-beta1Friedemann Kleint2016-03-241-1/+1
| | | | | | | | Fix warning: qtx11extras/src/x11extras/qx11info_x11.cpp:379: warning: Can't link to '-1' Change-Id: I8165a6e2b512a1fc265f4946e8fdc47dc3558109 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Add QX11Info::isCompositingManagerRunning() functionGabriel de Dietrich2016-03-221-0/+25
| | | | | | | Task-number: QTBUG-41195 Change-Id: Id4b385478dad85dd02c484fe9c44666bae46268b Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Gabriel de Dietrich2016-03-211-8/+19
|\ | | | | | | Change-Id: I406ef8471dca716daf694a0bb88dc7295c6d0a5e
| * Properly get appDpiX, appDpiY and appRootWindow for X screenv5.6.1-1v5.6.15.6.1Alexander Volkov2016-03-051-8/+19
| | | | | | | | | | | | | | | | | | | | X screen is a virtual desktop in Qt terminology. So find the first QScreen which belongs to the requested virtual desktop and use it to get the values. Change-Id: If5c08ff6c3e19e1d49d17ae8e1c54e09ffeb97cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-201-16/+22
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I4330fc4948a0f87880e57f1222d558c38f313564 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Do not return null Display or Connection when there are no screensv5.5.0-rc1v5.5.0-beta1v5.5.05.5.0Jan Kundrát2015-03-131-2/+2
| | | | | | | | | | | | | This is a followup change for recent changes in QtGui which now handles a situation where there are no outputs, and hence a nullptr QScreen comes haunting us. Thanks to Martin Gräßlin for pointing out where the problem is, and to Richard Moore for explaining how to fix it. Change-Id: I8f70c7a0b232073d4edb55b29eb19dae9fc09413 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Update copyright headersv5.5.0-alpha1Antti Kokko2015-02-161-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I5b54cb4819a4d35dd9136d4250f83871bd15c449 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Update license headers and add new licensesv5.4.0-alpha1Antti Kokko2014-08-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I173cdbf20a35132737586a9cdbfc2a6f209f6d6a Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* QX11Info: add nextStartupId/setNextStartupId - for startup-notificationDavid Faure2014-04-121-0/+47
| | | | | | | | | | This controls what the next window to be shown will send as startup-notification message. http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt Change-Id: Ia1b5e6ba004d61ca6fdfd6683d2e22dfcd0c42fb Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Doc: Remove references to nonexistent functionsSergio Ahumada2014-03-281-3/+3
| | | | | | | | | | | | | | - setAppDpiX() - setAppDpiY() - screen() they only exist in Qt 4.8. Change-Id: Ifca7cf9712a9b822b0776f413451d6bca7c69a37 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* remove QtWidgets dependencyTasuku Suzuki2014-03-141-2/+1
| | | | | | | | | The module doesn't depend on QtWidgets any more. Change-Id: Ic8036ec1ee53ef8b1a3bb6c827fb815f322865a2 Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Use nativeResourceForIntegration "rootWindow" to get the appRootWindowMartin Gräßlin2014-03-081-11/+4
| | | | | | | | As the native interface can provide the root window it's better to use that instead of going through QDesktopWidget. Change-Id: I0a7b475b5ef2a802f603b29762bf2d9033dfa13d Reviewed-by: David Faure <david.faure@kdab.com>
* Properly get X screen application is running on in appScreenv5.2.0-beta1Martin Gräßlin2013-10-011-2/+15
| | | | | | | | | | | | | | | QDesktopWidget does not provide the X screen number. No matter on which X screen an application is started, QDesktopWidget returns 0. Therefore resolve the X screen through the native interface's x11 screen resource. The documentation is improved to make it more obvious that this is about the X screen and not the RandR screen. Change-Id: I0f78a728769cbdfcac8b67b4fd5de0934f498027 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: David Faure <david.faure@kdab.com>
* Add a method to let users determine if the current platform is X11.v5.2.0-alpha1Richard J. Moore2013-09-091-0/+10
| | | | | | | | In order to know if the methods in QtX11Extras are usable the user should have a way to tell if they're running on X11. Change-Id: I096267eb1f1fe07ee11811574a96100389c33b7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add convenient method getTimestamp to QX11InfoMartin Gräßlin2013-08-121-0/+19
| | | | | | | | Provides access to the getTimestamp method in the XCB plugin which allows users to retrieve the current X timestamp. Change-Id: Ib6acd44c8ff899265ed6826f36b88fe427ff58c3 Reviewed-by: David Faure (KDE) <faure@kde.org>
* Doc: landing and module page for Qt X11 ExtrasNico Vertriest2013-04-121-2/+3
| | | | | | | | | Ingroup statement in qx11info_x11.cpp Removed trailing whitespace Change-Id: I03c16014f66a809f1c31b4501ffd1ca0691b5ee7 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix crash when qApp is a QCoreApplication.David Faure2013-03-261-0/+12
| | | | | | | | | | Yes, it makes little sense to call QX11Info API in such cases; but it happens currently in kio unittests which calls code which creates dialogs but never show them to the user (since they are unittests). With this fix, the tests pass. Change-Id: I96cd2080891a960aa405d98fd1801253930bde1e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QX11Info: return unsigned long rather than Qt::HANDLE.David Faure2013-02-041-2/+2
| | | | | | | | Qt::HANDLE has changed from unsigned long (on X11) to void* (everywhere) in Qt5, so we have to use "unsigned long" explicitly here. Change-Id: I4b16d1492dcb43fde5a4637d33f049854bec898a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Rename "support" to "extras" everywhere, to match the new module nameDavid Faure2012-12-181-0/+276
Change-Id: Ic089aa287b38b756bb9f0bc252c4120859afcefa Reviewed-by: Richard J. Moore <rich@kde.org>