summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen
Commit message (Collapse)AuthorAgeFilesLines
* Rename QWSI::handleWindowActivated to QWSI::handleFocusWindowChangedTor Arne Vestbø2023-11-231-2/+2
| | | | | | | | | | | | | | | | | | | A single QWindow is QGuiApplication::focusWindow() at a time, and this window is typically also QWindow::isActive(), but other windows may also be QWindow::isActive(). For example, we treat any sibling or ancestor of the focusWindow as being QWindow::isActive() as well. In addition, in the case of non-QWindow child windows, we may have to query the platform for the activation state, which means we also need a way for the platform to reflect changes in this state through QWSI. The current API for this, QWSI::handleWindowActivated, is in practice a focus window change API, so as a first step let's rename it to better reflect what it's doing. Task-number: QTBUG-119287 Change-Id: I381baf8505dd13a4a829c961095a8d2ed120092b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-101-9/+1
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-1/+1
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* plugins: use nullptr instead of 0 and NULLJohannes Kauffmann2022-10-022-2/+2
| | | | | Change-Id: I7f3e56db1d0db178d8a7d9eb91c09e03cae89f6b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QOffscreenIntegration: Don't keep around removed screensTor Arne Vestbø2022-09-091-2/+2
| | | | | | | | | | | | | | | The implementation of QOffscreenScreen::virtualSiblings() uses the list of screens maintained in QOffscreenIntegration as input, so we need to remove screens from this list as we remove them, to avoid treating removed screens as siblings of still remaining screens. While we're at it, remove the screens in reverse order, so that the primary screen is the one removed last. This avoids having to update the primary screen and move windows for each screen removed during shutdown. Change-Id: I9ab09dd75dbe20f63b9154533613bc59da531fd1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix compilation with clangSona Kurazyan2022-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Amends 711105058afe68407a0ed613335a83b6181112ed and fixes the following errors: .../qeglfsx11integration.cpp:28:36: note: non-constexpr constructor 'QBasicAtomicInteger' cannot be used in a constant expression Q_CONSTINIT static QBasicAtomicInt running; ^ .../qbasicatomic.h:171:5: note: declared here QBasicAtomicInteger() = default; And: .../qoffscreenwindow.cpp:171:50: error: 'constinit' specifier missing on initializing declaration of 'm_windowForWinIdHash' [-Werror,-Wmissing-constinit] QHash<WId, QOffscreenWindow *> QOffscreenWindow::m_windowForWinIdHash; ^ Q_CONSTINIT .../qoffscreenwindow.h:44:5: note: variable declared constinit here Q_CONSTINIT static QHash<WId, QOffscreenWindow *> m_windowForWinIdHash; Change-Id: I991674826737db897e087e9e06b56b338ca61a4f Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
* Apply Q_CONSTINIT where beneficialSona Kurazyan2022-09-011-1/+1
| | | | | | | | | | Applied Q_CONSTINIT to variables with static storage duration, but skipped the POD types with core constant initializers. Task-number: QTBUG-100486 Change-Id: Iaabf824e9cb0f29a405a149912200d4e4b3573c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-169-342/+18
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Plugins: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-042-4/+8
| | | | | | | | | As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I7fadd3cf27ad099028d70f05956303e3af62c0f5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Don't blit individual rects of region when when scrolling backingstoreTor Arne Vestbø2022-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | The QPlatformBackingStore::scroll() API takes a QRegion as input, but we have no guarantee that the individual source and destination rects of the region will not overlap each other when applying the scroll offset, so we can't naively iterate the rects and call qt_scrollRectInImage for each one. The reason this didn't cause any issues in practice was that the QWidget repaint manager was always passing in a single rect as the region. On the other hand, the client has requested a scroll of the given region, so it might assume any other part of the backing store is preserved as is. Scrolling the bounding rect of the region violates this assumption. Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25. Pick-to: 6.2 6.3 Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Offscreen: Fix implementation of QScreen::grabWindowVolker Hilsheimer2022-01-261-12/+16
| | | | | | | | | | | | | | | | | | | | | | If id == 0, then we should grab the specified rect from the screen. To do that, find all windows intersecting with the screen geometry, and compose their backing store images into a screen-size pixmap. Otherwise, find the respective backing store and grab only that. Remove the old code respecting the desktop widget, which is no longer a thing in Qt 6. The code was also wrongly grabbing only the first containing - not intersecting - window's backing store into the screen pixmap. Enable the QScreen::grabImage test for the offscreen platform, where it now passes. Task-number: QTBUG-99962 Change-Id: I16eca7b082d65095a62c73624f86a4423e997a7a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Offscreen: Implement QPlatformBackingStore::toImageVolker Hilsheimer2022-01-261-0/+1
| | | | | | | | | | | | | Re-applies 77895514d5419b77535de093b544aee30686cd22, which was reverted after tests started to XPASS-fail in qtdeclarative. Those tests are now get consistently QSKIP'ed, so reapply the change. This makes testing of actually produced output easy in unit tests, and makes a number of previously failing QtDeclarative tests pass. Task-number: QTBUG-99962 Change-Id: I167b46b954dee18bdbf90c09c5e42a8c179a1fac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "Offscreen: Implement QPlatformBackingStore::toImage"Volker Hilsheimer2022-01-221-1/+0
| | | | | | | | | | | | | | This reverts commit 77895514d5419b77535de093b544aee30686cd22, which is in principle correct, but results in XPASS'ing tests in qtdeclarative that we need to adapt first. Originally reverted only for 6.3, but now also in dev given the amount of tests that have a QEXPECT_FAIL for the offscreen platform in qtdeclarative. Change-Id: Ic914655c737c3b279c14a66220775f3c7a6cdab8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 8498d1a14b5a8392ee6b50a87b82f9d85d13193e) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Offscreen: Implement QPlatformBackingStore::toImageVolker Hilsheimer2022-01-181-0/+1
| | | | | | | | | This makes testing of actually produced output easy in unit tests. Pick-to: 6.3 Task-number: QTBUG-99962 Change-Id: Ia806539230af12d1eae1e31ef7a47155d9bc1bed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QPA: Set focus reason when window activation changes focusVolker Hilsheimer2021-12-031-2/+2
| | | | | | | | | | | | | | | QApplication hides the fact that the reason is never set by several QPA plugins, but Quick items don't receive the correct reason on Windows, Android, the offscreen plugin, and other platforms. Add relevant scenario to the QFocusEvent test case, and fix the plugins to always set the focus reason when handling window activation changes. Exclude the minimal plugin from the test, it seems largely unmaintained anyway. Task-number: QTBUG-75862 Change-Id: I5404a225b387fc9a3851b6968d0777c687127ed1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QOffscreenX11PlatformNativeInterface a QX11ApplicationMichal Klocek2021-10-212-1/+15
| | | | | | | | | | | | | | Make it possible to use new native interface QX11Application with offscreen plugin in case of x11, which technically is x11 application without xcb connection. This change is motivated by use of new native interface in webengine, where offscreen plugin is used for some tests. Pick-to: 6.2 Change-Id: Ic2ed5b39573062feaa1e8985962d5d9327b371d7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: send enter/leave when a window opens/closesVolker Hilsheimer2021-09-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Since macOS doesn't give us any event when a modal window opens, we need to do so ourselves explicitly so that the current mouse window gets a leave event when e.g. a popup opens, and an enter event when the popup closes again. The case for modal dialogs is partially handled by QGuiApplication already. Note: We cannot rely on the transientParent of the opening/closing window, as it's nullptr for QMenu windows even if the QMenu has a widget parent. Add a test for enter/leave events when a secondary window opens, covering both the dialog and the popup case. For the dialog case, we sometimes get two Enter events when the dailog closes, which we have to tolerate for now. To make the test pass on b2qt platforms, fix the offscreen plugin to explicitly send enter/leave events in the same way as Cocoa now does. Fixes: QTBUG-78970 Pick-to: 6.2 Change-Id: If45e43e625e8362c3502c740154f6a6a8962b9e9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* High-dpi configuration change testingMorten Johan Sørvig2021-09-083-1/+42
| | | | | | | | | | | | Export configuration() and setConfiguration() from the offscreen platform plugin using QPlatformNativeInterface. tst_qighdpi can then resolve and make use of them since it always uses the offscreen platform plugin. Add screenDpiChange() auto test. Change-Id: I459b4df5d94ec4991234a346e3a94618cb3485e9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Offscreen: add configuration update APIMorten Johan Sørvig2021-09-085-42/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for updating the platform configuration at runtime, which enables use cases such as changing the screen configuration from an auto test. Provide functions for getting and setting the complete configuration as a QJsonObject: QJsonObject configuration() void setConfiguration(QJsonObject) User code can then either set a completely new configuration, or make a smaller update by using a get-modify-set sequence: // Set the logical DPI for screen 0 to 192: auto config = configuration(); config[“screens”][0][“logicalDpi] = 192 setConfiguration(config); This approach means we can expose a minimal but complete API, at the cost of doing more work in the offscreen plugin in order to figure out what changed. Note that this change does not export thew API from the platform plugin. Change-Id: If776c36d5ae6d72dca715cc8e89e42768ed32c60 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Rename qt6_add_plugin TYPE option to PLUGIN_TYPEAlexandru Croitor2021-08-061-1/+1
| | | | | | | | | | | | | The intention is to remove TYPE as a keyword completely before 6.2.0 release, but in case if that's not possible due to the large amount of repositories and examples, just print a deprecation warning for now and handle both TYPE and PLUGIN_TYPE. Task-number: QTBUG-95170 Pick-to: 6.2 Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix memory leak of QOffscreenScreen in QOffscreenIntegrationMilian Wolff2021-07-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Call handleScreenRemoved when the QOffscreenIntegration is getting destroyed. Fixes memory leaks such as this one: ``` $ memcheck --leak-check=full ./tst_qlabel -platform offscreen ... ==117791== 472 (88 direct, 384 indirect) bytes in 1 blocks are definitely lost in loss record 166 of 267 ==117791== at 0x483EF3F: operator new(unsigned long) (vg_replace_malloc.c:417) ==117791== by 0x48C0939: QOffscreenIntegration::configure(QList<QString> const&) (in /home/milian/projects/qt5/src/qtbase/build/plugins/platforms/libqoffscreen.so) ==117791== by 0x48C0B60: QOffscreenIntegration::createOffscreenIntegration(QList<QString> const&) (in /home/milian/projects/qt5/src/qtbase/build/plugins/platforms/libqoffscreen.so) ==117791== by 0x5381CB4: init_platform(QString const&, QString const&, QString const&, int&, char**) (in /home/milian/projects/qt5/src/qtbase/build/lib/libQt6Gui.so.6.2.0) ==117791== by 0x5384E05: QGuiApplicationPrivate::createPlatformIntegration() (in /home/milian/projects/qt5/src/qtbase/build/lib/libQt6Gui.so.6.2.0) ==117791== by 0x5385B1F: QGuiApplicationPrivate::createEventDispatcher() (in /home/milian/projects/qt5/src/qtbase/build/lib/libQt6Gui.so.6.2.0) ==117791== by 0x5C67A76: QCoreApplicationPrivate::init() (in /home/milian/projects/qt5/src/qtbase/build/lib/libQt6Core.so.6.2.0) ==117791== by 0x5387826: QGuiApplicationPrivate::init() (in /home/milian/projects/qt5/src/qtbase/build/lib/libQt6Gui.so.6.2.0) ==117791== by 0x4C00368: QApplicationPrivate::init() (in /home/milian/projects/qt5/src/qtbase/build/lib/libQt6Widgets.so.6.2.0) ==117791== by 0x11D7D9: main (in /home/milian/projects/qt5/src/qtbase/build/tests/auto/widgets/widgets/qlabel/tst_qlabel) ==117791== ``` Pick-to: 6.2 Change-Id: Ibf4e6f4258514f85f23bb91b29008b837016edbc Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Put the GLX related code under the xcb_glx_plugin conditionAlexey Edelev2021-05-062-3/+10
| | | | | | | | | | If the xcb-glx-plugin feature is not enabled we should not compile classes and methods that use the GLX related code of the QOffscreenIntegrationPlugin. Pick-to: 6.1 6.0 Change-Id: I63eff9d0a2afc1bc1fa21ee1b49f854f13b94c93 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* cmake: Don't give plugins PUBLIC usage requirementsCraig Scott2021-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The pro2cmake.py conversion script faithfully reproduced the .pro files for the plugins, which specified the libraries as public. But in CMake, the implications of this are that public usage requirements should then be propagated to consumers. We don't expect any consumers, since a plugin is created as a MODULE library in CMake, so for Windows we don't even have an import library to link with. The only exception to this is for static builds where plugins are created as STATIC libraries instead, but only in certain controlled situations do we then link to plugins. Even then, usage requirements are not expected to propagate to the consumers, so these relationships should always be specified as private. This change warns on any PUBLIC usage requirements specified for a plugin. This check is disabled by default to avoid spamming CI builds for repos that haven't been fixed yet. The check can be enabled by a CMake cache option, which is intended for developers to use locally when fixing this issue in other repos (all plugins in qtbase should not trigger this warning as a result of changes in this commit). Task-number: QTBUG-90819 Pick-to: 6.1 Change-Id: I09f2c8da77db1193ad3370f85d367dfc6ab7b9a6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-121-38/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-28/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add a platform capability indicating support for QRhi-based renderingLaszlo Agocs2021-01-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attempts to reconcile a minor difference between Qt 5 and Qt 6: Running Qt Quick applications with a platform plugin such as vnc, led to an automatic fallback to the 'software' backend based on the OpenGL capability reported from the platform plugin. In Qt 6.0 this logic is gone from Qt Quick, because we do not have, and wish not to have, individual flags for each and every 3D API on this level. Therefore in Qt 6.0 a Qt Quick application running with the vnc (or linuxfb, or minimal) platform needs an explicit selection of the software backend via QT_QUICK_BACKEND or QQuickWindow::setGraphicsApi(). To keep migration for users of such platform plugins easier, we can still reintroduce a Qt 5-like logic: by having a high level Is-QRhi-Supported type of flag, we can make Qt Quick query that, and trigger the fallback to the software backend when it is reported as false by the platform plugin. As this is the minority case and a conscious choice by platform plugins, the flag can be opt-out (i.e. true by the default hasCapability implementation). When it comes to the existing OpenGL flag, that needs to stay for compatibility reasons, but it is worth noting that the new flag semantically falls in the exact same category: it does not indicate things will really work at run time, but rather serves as an opt-out, "do not even try" type of declaration the platform plugin can make, which then allows modules like Qt Quick to make early, upfront decisions about which rendering paths/backends to take. Change-Id: I8d6fddeb82ca6eece7b7abc1a5b64ebe6d8af29d Task-number: QTBUG-89561 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* offscreen: always create a valid QPlatformIntegrationMorten Johan Sørvig2020-12-211-2/+3
| | | | | | | | | | | | | Commit f4a66e5c accidentally made it so that the offscreen plugin would produce a null QPlatformIntegration on X11 if QT_QPA_OFFSCREEN_NO_GLX is set. Restore previous logic where the generic QOffscreenIntegration is created if the X11 code path did not create an object. Change-Id: Ic71fb04bbd824f4121480dbaf8fa0571ebb39f42 Pick-to: 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add font function to OffscreenTheme to run unit tests with offscreenAndreas Buhr2020-11-241-0/+14
| | | | | | | | | | | Two unit tests fail at the moment with the offscreen theme because the font function of the offscreen theme does not return a monospace font when asked for a monospace font. This patch fixes it. Change-Id: Id682c75e2a94b246cffe97b342b1b562bac82a68 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Offscreen QPA: implement a native interfaceGiuseppe D'Angelo2020-10-306-17/+50
| | | | | | | | | | | | | | | | Many code paths simply expect to have a native interface available, and won't check if a plugin is returning nullptr for it. This leads to crashes or local workarounds (e.g. 3197932e6fb03fb9c0ff669af858cb94e3836d79). Instead, have offscreen implement a dummy native interface. This requires shuffling some code for the X11 integration. Pick-to: 5.15 Change-Id: I2bdceee379e4ded9b085ebbb4d03d1e074f60726 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QPA offscreen: make platform plugin configurableMorten Johan Sørvig2020-10-207-20/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ability to load a json config file containing screen configuration at startup. The config file location is specified using platform options: -platform offscfreen:configfile=/path/to/file Config file format example: { “screens”: [ { "name", "screen-1", "x", 0, "y", 0, "width", 640, "height", 480, "dpi", 96, "dpr", 1, }, … ] } Change-Id: Iac21aaafa6d0f361bdd6f6e9168b7e68db6ae011 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-232-2/+2
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QStyle: return 'Fusion' instead of 'fusion'Richard Moe Gustavsen2020-09-121-1/+1
| | | | | | | | | | | | This change should have no impact on Widgets, since style names there are case-insensitive. But for QtQuick controls the style names are case sensitive. So in order to use the style hint from the platform theme for controls, we need to return the name with an uppercase "F". Change-Id: I360f43f174938202b0ef2cdfcde6daf39c9f39bb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Do not expose xlib as public dependency of QtGuiJoerg Bornemann2020-09-113-0/+5
| | | | | | | | Consumers of QtGui should link explicitly to xlib if needed. Fixes: QTBUG-86421 Change-Id: Ibc94eb1c1ac405b53749b320c388b037bf693a08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Avoid crashing in offscreen with X11 builtin but not availableAllan Sandfeld Jensen2020-09-091-2/+4
| | | | | | | Pick-to: 5.15 Change-Id: Id385bc750f1cc6dfc2ad7e0248dbc56fa5b6e4d2 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Get rid of hasPendingEvents() and flush()Lars Knoll2020-09-061-13/+0
| | | | | | | They are unused. Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build with mingw gcc 9 and -Wsuggest-overrideKai Koehne2020-08-101-3/+3
| | | | | Change-Id: I780b0761a7f6b19022116b738efa7aca1378b715 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move glxconvenience into QtGuiFriedemann Kleint2020-07-104-6/+1
| | | | | | | | | OpenGL is not quite as dead as initially assumed. Task-number: QTBUG-83255 Change-Id: I953040149812a5258caad5fe6bac0835e1982dd0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move qglxconvenience to QtOpenGLFriedemann Kleint2020-07-084-4/+4
| | | | | | Task-number: QTBUG-83255 Change-Id: I7640caf8afbae0a7310a264f333bb3a6cfa3c6ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Introduce platform API abstraction for QOpenGLContextTor Arne Vestbø2020-07-022-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is available by including qopenglcontext.h as usual, but scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QCocoaGLContext::fromNative(nsContext, shareContext); b) Access to underlying native handles, e.g. openGLContext->platformInterface<QCocoaGLContext>->nativeContext() c) Platform specific functionality, e.g. static QWGLContext::openGLModuleHandle() openGLContext->platformInterface<QEGLContext>->doSomething(); The platform interfaces live close to the classes they extend, removing the need for complex indirection and plumbing, and avoids kitchen-sink modules and APIs such as the extras modules, QPlatformFunctions, or QPlatformNativeInterface. In the case of QOpenGLContext these platform APIs are backed by the platform plugin, so dynamic_cast is used to ensure the platform plugin supports the requested interface, but this is and implementation detail. The interface APIs are agnostic to where the implementation lives, while still being available to the user as part of the APIs they extend/augment. The documentation will be restored when the dust settles. Task-number: QTBUG-80233 Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move Unix font databases into QtGuiFriedemann Kleint2020-06-154-15/+3
| | | | | | Task-number: QTBUG-83255 Change-Id: Id85a1e0f3de371951783fe97485158c4a02e1f15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move windows font databases into QtGuiFriedemann Kleint2020-06-113-3/+3
| | | | | | | | | | Requires adapting a few config checks since cmake currently does not detect directwrite. Task-number: QTBUG-83255 Task-number: QTBUG-83931 Change-Id: I521f1924f701260b41dccbcecf87b19f08df5ccc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move the UNIX event dispatchers into QtGuiFriedemann Kleint2020-06-104-14/+3
| | | | | | Task-number: QTBUG-83255 Change-Id: I7d32eb1ec01784c9ed6bf5fc4913ffc5b3a34a49 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move the Windows Event Dispatcher into QtGuiFriedemann Kleint2020-06-093-6/+14
| | | | | | Task-number: QTBUG-83255 Change-Id: Ida86f27d7f52b9be48fbea909979320866ff8dae Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove winrtOliver Wolff2020-06-061-8/+0
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate src/pluginsAlexandru Croitor2020-05-292-4/+12
| | | | | Change-Id: Icceceeb42023e7fa5edf320bb21f03d11bd357b7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>