summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
Commit message (Collapse)AuthorAgeFilesLines
* Fix VNC format conversionAllan Sandfeld Jensen2021-01-134-8/+9
| | | | | | | | | | | | Pass the right from depth to the conversion function, and set the right format before creating the compositor image for RGB16 support. Pick-to: 6.0 5.15 Fixes: QTBUG-85621 Change-Id: I76f46a3c2d8f1d2b040b790035dbdb0a960ff1a7 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-1219-1434/+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>
* macOS: Don't try to close already-closed/closing file dialogTor Arne Vestbø2021-01-121-1/+7
| | | | | | | | | | | | | | | | | Doing so results in a warning about "modalSession has been exited prematurely - check for a reentrant call to endModalSession:", and on Big Sur will also result in the file failing to save because the return code from runModal will no longer be NSModalResponseOK. This would happen when the completion handler for beginSheetModalForWindow would call QNSOpenSavePanelDelegate_panelClosed, resulting in calls to QDialog::done(), which in turn tries to hide the dialog, via QCocoaFileDialogHelper::hideCocoaFilePanel(). Pick-to: 6.0 5.15 Fixes: QTBUG-89959 Change-Id: I048afe3dcc7fe62e0d0273f12b4b2c0237abb052 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Windows QPA: Fix crashes when using screen reader with Q(Plain)TextEditFriedemann Kleint2021-01-121-2/+6
| | | | | | | | | Make sure the search start with valid values. Pick-to: 6.0 5.15 Task-number: QTBUG-89354 Change-Id: I5b5100db89c62f23748b5c88e9188cfe3811e6e8 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Revert "Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for ↵Morten Johan Sørvig2021-01-111-3/+2
| | | | | | | | | | | | | | | | | | | full update only" This reverts commit a81dfb32d6f9e7a407567511c20b59e537f6a063. Paint immediately on WM_PAINT in all cases in order to avoid flicker on resize. The cases mentioned in commit a81dfb should no longer apply: - QTBUG-38327: QGLWidget is not supported in Qt 6. - QTBUG-39842: Fixed by using ExcludeUserInputEvents. Fixes: QTBUG-89688 Change-Id: If82cf7703d6663982769048e86a7060223730ce7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Send Qt::Key_MediaTogglePlayPause for VK_MEDIA_PLAY_PAUSEAllan Sandfeld Jensen2021-01-081-1/+2
| | | | | | | | | | Speculative fix to get the right keys in WebEngine Pick-to: 6.0 5.15 Fixes: QTBUG-89915 Change-Id: I79519b715a1415dccfc4601aae5025b3222a79ae Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Fix missing QScreen change updatesFriedemann Kleint2021-01-083-29/+2
| | | | | | | | | | Remove the logic compressing WM_DISPLAYCHANGE signals by the WParam/LParam since it also triggers when the geometry is changed by rearranging screens. Fixes: QTBUG-79442 Change-Id: I00042c9e687bdb67fc17d6c507818b79a7aee0a2 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-0750-1719/+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>
* Windows QPA: Lookup DISPLAYCONFIG data for monitorsAllan Sandfeld Jensen2021-01-071-2/+94
| | | | | | | Gives more accurate orientation and refresh-rate. Change-Id: I90b0b7563efc35c9bace07ccb3996350a957e8e5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Clean up code that handle clipboard image conversion on WindowsCamille Viot2021-01-061-126/+14
| | | | | | | | | | | | | | This commit remove old legacy code that try to deal with clipboard image conversion in the qwindowsmime class. It now uses qbmphandler under the hood which is much more complete. It also add a small fix for the conversion of BI_RGB clipboard image with an explicit alpha layer (which Firefox use on Windows). Change-Id: Iae026378831799dc676e1aba7d5bd6a0d1c01e7f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add a platform capability indicating support for QRhi-based renderingLaszlo Agocs2021-01-045-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add a dedicated QWindow surface type for D3DLaszlo Agocs2021-01-042-17/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though there is no D3D-specific logic in the windows platform plugin, meaning a QWindow with either OpenGLSurface or VulkanSurface (or anything really) is DXGI/D3D-compatible, it now looks like it is beneficial, and more future proof, if there is a dedicated surface type. As the linked report shows, there are OpenGL-specific workarounds accumulated in the platform plugin, while not being clear if these are relevant to non-OpenGL content, or if they are relevant at all still. (and some of these can be difficult/impossible to retest and verify in practice) When D3D-based windows use the same surface type, all these are active for those windows as well, while Vulkan-based windows have their own type and so some of these old workarounds are not active for those. To reduce confusion, having a dedicated surface type for D3D as well allows the logic to skip the old OpenGL workarounds, giving us (and users) a more clear overall behavior when it comes to OpenGL vs. Vulkan vs. D3D. The change is compatible with any existing code in other modules because any code that uses OpenGLSurface for D3D will continue to work, using the new type can be introduced incrementally. Task-number: QTBUG-89715 Change-Id: Ieba86a580bf5a3636730952184dc3a3ab7669b26 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: document QXcbEventQueue::PeekOption enumGatis Paeglis2021-01-012-8/+23
| | | | | | | | And renamed PeekRemove* to PeekConsumed to document better that nodes are not removed when peeking. Change-Id: I7349f57fcfc3287d1a1309a31ee7f481f8d18755 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* eglfs: Enable building the fbdev-based Mali backendLaszlo Agocs2020-12-282-1/+27
| | | | | | | | | The configure tests are all in place for CMake as well, and this one has no special library depdendencies. Generate the CMakeLists and remove the special case. Change-Id: I55817045f9e259515fb3aad33d1446d9413111d9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Handle XCB_INPUT_DEVICE_TYPE_MASTER_POINTER properlyPaul Olav Tvete2020-12-252-4/+9
| | | | | | | | Make sure we use the new QXcbScrollingDevice class for the "core pointer" as well. Change-Id: I97575e8125cbb2aa280662aa675e61021c21ea59 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adjust the format of code blocks in handleScreenChange functionLu Zhen2020-12-251-1/+1
| | | | | Change-Id: I5da777e2196c005d6d5402c254a9452c3a888036 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix out-of-bounds writePaul Olav Tvete2020-12-233-24/+33
| | | | | | | | | | | | | Change ac210c73e4 introduced the requirement that all input devices with Scroll capability must have a QXcbScrollingDevicePrivate as their d_ptr. However, this was not enforced, and would fail for the "Virtual core pointer". To fix this, always use qobject_cast to verify that the device is of the correct type. Change-Id: I4a6b1d4d79308eb04e9f52dda00294fffe377bdf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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>
* Android: KEYCODE_MEDIA_PLAY_PAUSE translated rightPiotr Mikolajczyk2020-12-211-1/+1
| | | | | | | | | | KEYCODE_MEDIA_PLAY_PAUSE was incorrectly translated to Qt.Key_MediaPlay. This patch changes it to Qt.Key_MediaTogglePlayPause. Fixes: QTBUG-66448 Pick-to: 5.15 5.12 6.0 Change-Id: Icd2747857bc479228bfdffcd8ab8fdef7b79e918 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* xcb: fix thread synchronization in QXcbEventQueue::waitForNewEvents() againIgor Kushnir2020-12-183-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends a41701904e880f58e19b352ade1931d6cd1a7112 If peeking into the event queue looking for a clipboard event fails, QXcbClipboard::waitForClipboardEvent() calls queue->peek for the second time to "process other clipboard events, since someone is probably requesting data from us". QXcbEventQueue::peek() in turn calls QXcbEventQueue::flushBufferedEvents(). This second flushing can acquire a waited-for clipboard event. The issue was that the code in waitForNewEvents() ignored this possibility and assumed that there were no clipboard events before or at its current m_flushedTail. If there were no more events on the X11 connection after tailBeforeFlush, the waitForNewEvents() in waitForClipboardEvent() blocked execution for 5 seconds and eventually timed out. The fix is to remember QXcbEventQueue::m_flushedTail just after looking for and not finding a clipboard event in the queue. And then wait for more events via QWaitCondition in waitForNewEvents() only if there were no more events after the remembered m_flushedTail. Fixes: QTBUG-75319 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I4919c5b9b9227b3a8a29a11e7094f97960b3a121 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Android: Fix for accessibility potential crashPiotr Mikolajczyk2020-12-181-1/+1
| | | | | | | | | When accessibility was not active it was possible to force its update, causing a null pointer exception in java. Pick-to: 6.0 5.15 Change-Id: I60f65612d6e9f712ba3c591ffcc6803f06f09efb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Fix 'static' conditionsJoerg Bornemann2020-12-171-1/+2
| | | | | | | | | The pro2cmake script doesn't handle static scopes correctly, and the generated "CONDITION static" must read "CONDITION NOT QT_BUILD_SHARED_LIBS". Change-Id: Ic5a5763e9fd5f5d04fb4c12227cbe85fac17b826 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Android: Pass pending state to ResumePauseListenerBartlomiej Moskal2020-12-171-1/+6
| | | | | | | | | | | | | | | | | | | It can happen that updateApplicationState() is called before m_androidPlatformIntegration is set. In such case, new applicationState will be remembered and propagated later. Before this change, pending application state was passed only to QWindowSystemInterface. ResumePauseListeners that are subscribed for changes to ApplicationActive/ApplicationInactive state also should be informed about new application state. Fixes: QTBUG-84737 Pick-to: 6.0 5.15 Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* xcb: report wheel events from the correct device instanceShawn Rutledge2020-12-156-91/+235
| | | | | | | | | | | | | | | | | Until now, all wheel events came from one "core pointer". It's useful in Qt Quick to tell the devices apart, because some support smooth scrolling and some don't. Also remove the QHash storing legacy ScrollingDevice structs, and use a subclass of QPointingDevicePrivate instead. Task-number: QTBUG-46412 Task-number: QTBUG-72167 Task-number: QTBUG-69433 Change-Id: Ie6a3d8dd494f981e8706b9a66a1021dfb51baec4 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* xcb: Fix available geometry after rotationAlexander Volkov2020-12-132-5/+10
| | | | | | | | | | | | | | QXcbVirtualDesktop::m_workArea is not updated after screen rotation if _NET_WORKAREA is not updated, e.g. when a window manager is not running. Use width of -1 for m_workArea to indicate that _NET_WORKAREA is not set and thus there is no need to find its intersection with screens' geometries. Pick-to: 5.15 6.0 Change-Id: Ic1f3ec23576ed8407a76cc2b9f84a145c67b1d4b Reviewed-by: Liang Qi <liang.qi@qt.io>
* macOS: Fix crash when showing parent-less platform menusTor Arne Vestbø2020-12-091-2/+2
| | | | | | | Pick-to: 6.0 Pick-to: 5.15 Change-Id: I80f02da1621e4088eb040bb16a4db3867b6ad4d7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* macOS: Remove warning about KVO observers on QNSWindow/QNSPanelTor Arne Vestbø2020-12-091-5/+0
| | | | | | | | | | | | | | | | | | NSTitleBarView in Big Sur will observe the window it is in, but makes sure to remove these observers in viewWillMoveToWindow, as it should. To avoid spamming user logs with this warning we remove it. It was dubious what cases it would have caught anyways, as anyone trying to KVO observe properties Z of a child object Y of X.Y would need to track whether X changes its Y between adding and removing the observer. There are no guarantees that Y is stable, and this applies to an NSView's window property as well. Pick-to: 6.0 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I27a0d04625f96c4c5d382c39ac068721ce1e8f9d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Qml accessibility fixesPiotr Mikolajczyk2020-12-085-13/+87
| | | | | | | | | | | | | | | | | | - Accessibility focus can follow the position of the widget (for example when swiping on a scrollview) - controls are clickable directly after appearing on the screen after scroll (previously you had to click somewhere else on the screen, and after that you could focus the newly appeared control) - checkbox and switch react correctly on click action - fixed combobox behavior with accessibility enabled Task-number: QTBUG-79611 Pick-to: 6.0 5.15 Change-Id: If36914ab0165f33593e68fd7ecf168693f8538a7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* wasm/js: fix invalid restartCount referenceAvindra Goolcharan2020-12-081-1/+1
| | | | | | | | | | | | The `restartCount` variable on line 245 is mutating global scope. The PR makes it consistent with the rest ob the code (`self.restartCount`). It was observed when importing the qtloader in a typical Webpack/Babel build environment. Change-Id: I338285f4f6bcb80df0c16d80cc3ebfec944a8be7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix highdpi conversion of QTabletEvent coordinates on xcbShawn Rutledge2020-12-081-4/+2
| | | | | | | | | | | | | | | Amends 1535fc9fb9ddbfce1680979c0634b4fdf8d75fca : when high-dpi scaling is enabled, there was an offset from the cursor position to the event position, because QWindow::mapFromGlobal() works in device-independent pixels, but we are using actual screen pixels here. Pick-to: 6.0 Pick-to: 5.15 Pick-to: 5.12 Task-number: QTBUG-77826 Change-Id: Ic8743b9e5c4041065f530ed1d9d6c49337b0207a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Always allow interacting with popup windows during modal sessionTor Arne Vestbø2020-12-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f4889e63c7b changed the worksWhenModal logic for QNSWindow to be based on the transient parent relationship of the child window to the modal session window, to fix many issues where windows that should be blocked were not. Unfortunately, some window types do not maintain a transient parent relationship (e.g. QCompleter, which is itself just a QObject), or are not common for users to create with a QWidget parent (such as a context QMenu). This change restores part of the special-casing that was removed in f4889e, so that all popup windows are always allowed to be interacted with during modal sessions. This includes popup windows that were opened as part of a parent modal session, which would normally be fully blocked, but we assume that popup windows are intermittent enough that this will not be a problem. For now we leave out the other two special casings from f4889e, namely tool windows and dialogs. The former should in most cases be created with a parent window, while the latter definitely should. Fixes: QTBUG-88188 Fixes: QTBUG-88985 Fixes: QTBUG-87849 Fixes: QTBUG-86845 Pick-to: 6.0 Pick-to: 5.15 Change-Id: I005a402b21e8dc16c3b18bcd7e67d12b94a66f44 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Re-generate project files in srcJoerg Bornemann2020-11-305-7/+2
| | | | | | Pick-to: 6.0 Change-Id: I1f5f822d68129490f1a7c495f718aead0b520ca9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Let QXcbConnection::getTimestamp properly exit when X server quitsSheng Mao2020-11-301-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | QXcbConnection::getTimestamp uses dummy events to get timestamp from X server. However, in some cases, X server shuts down while client tries to get timestamp. In this case, QXcbConnection::getTimestamp keeps getting null event and thus falls into indefinite loop. This fix checks if xcb connection is still valid and use a special xcb_timestamp_t value, CurrentTime (0L), as returned value. CurrentTime should not be generated by X server and if getTimestamp returns this value, it means an "exception" case is triggered. This fix is introduced because in kwin_x11 (KDE project), X server can exit on logout. kwin_x11 should handle disconnection from X server. But the indefinite loop prevents kwin_x11 to process disconnection event and therefore kwin_x11 cannot quit properly. Fixes: QTBUG-88435 Pick-to: 5.12 5.15 6.0 Change-Id: Iaf7ef3f8a35fa8389d22a608e3c49041bf90e1b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-302-2/+2
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Windows QPA: Pass device for synthesized touch/tablet eventsFriedemann Kleint2020-11-274-12/+41
| | | | | | | | | | | Add the overloads for mouse events with device/without timestamp and pass the active tablet or touch device. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Pick-to: 6.0 Change-Id: I8695b493540d0cbf50e9c72afe870a7633de3ab9 Reviewed-by: Oliver Wolff <oliver.wolff@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>
* wasm: fix resizing of qwidget windowsLorn Potter2020-11-232-1/+36
| | | | | | | | | This also fixes the cursor changing during resize mode Fixes: QTBUG-85361 Pick-to: 5.15 Change-Id: Ic85a5c31a8a2dc4265a84f16fd5fcdc231062c6d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix mouse double clickLorn Potter2020-11-232-6/+21
| | | | | | | | | | Two issues here, timestamp value was getting smashed, and MouseButtonDblClick was not getting sent. Fixes: QTBUG-85712 Pick-to: 5.15 Change-Id: I912e968f1eb0fb9c6f4cf8548b114e23d182396e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Propagate device-pixel-ratio of system tray iconTor Arne Vestbø2020-11-201-0/+1
| | | | | | | | | | | | | | | | | When preparing a system tray icon on a system with a retina screen, we end up creating a full-height icon of height 44. If there's also a 1x screen available, macOS will scale down this image for us when presenting the icon on the 1 screen, but the downscale will fail to preserve the aspect ratio of the original image on Big Sur. Telling macOS which device-pixel-ratio the image has seems to fix this, and is the right thing to do in any case. Pick-to: 5.15 Pick-to: 5.12 Fixes: QTBUG-88600 Change-Id: Ic31def94d073da1b256bbfcaf5905f92c169f43d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QFont: Prefer setFamilies() over setFamily()Andy Shaw2020-11-201-1/+1
| | | | | | | | | | | | | | | | By depending on setFamilies() then we can be sure that font names with spaces, commas, quotes and so on are correctly handled without being misinterpreted. For now it will split on the comma when a string containing one is passed to setFamily. But from Qt 6.2 this will be removed to preserve the family string as a convenience function. [ChangeLog][QtGui][QFont] Indicated that setFamilies/families is preferred over setFamily/family to ensure that font family names are preserved when spaces, commas and so on are used in the name. Change-Id: Id3c1a4e827756a4c928fed461a4aafa5a0f06633 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Disable copying and assigning of QEventVolker Hilsheimer2020-11-192-15/+21
| | | | | | | | | | | | | | Polymorphic classes should not be copied. However, we do rely on event copying in our propagation logic. So, make the members protected, don't delete them, using a dedicated macro. This way, QMutable*Event classes can be used to make copies. Remove some last usage of copying of QInputMethod(Query)Events. Change-Id: Ia0a8ae4ca9de97dcd7788ca3c6ed930b6460c43a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: Avoid use-after-free in QXcbConnection::initializeScreens()Alexander Volkov2020-11-181-2/+4
| | | | | | | | | | | Extend the scope of the resources variable to avoid its destruction while it's still in use. Fixes: QTBUG-88512 Pick-to: 5.15 5.12 Change-Id: I3298aabc871ff455bd1203ec276e7600d3e151ef Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Correct headers to build with eglfs modulesElvis Lee2020-11-1717-27/+9
| | | | | | | | | | | | | | To build with eglfs module and gbm device integration module, some headers should consider global path, not local. This covers eglfs_kms and eglfs_kms_egldeivce device integration. Other device integrations might be future work if needed. Task-number: QTBUG-85268 Change-Id: I1bad5fbac99aa79d146e90f88b53519b09254e13 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
* Android: Ensure windows always have a geometry on creationPiotr Mikolajczyk2020-11-171-0/+10
| | | | | | | | | | | | | | | A QWindow created without an explicit geometry needs to pick up a default geometry in the platform plugin. If the window has a maximized of fullscreen window state, it will fill the entire available geometry of the parent window (or the screen if there's not parent window). Fixes: QTBUG-69159 Fixes: QTBUG-69156 Fixes: QTBUG-69154 Pick-to: 5.15 Change-Id: If8565d92a97bb4b3fa44757e68969d54d0bc7ebe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-1/+1
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* QFileInfo: mark constructors as explicitGiuseppe D'Angelo2020-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | These look like leftovers (API flaws). Construction of QFileInfo from QString (or similar) should be not implicit, as QFileInfo construction is expensive (might hit the file system), and this may have users overlook APIs (for instance build a QFileInfo out of QDirIterator::next(), instead of using ::fileInfo(); using QDir::entryList instead of entryInfoList; etc.). Leave an opt-out mechanism to ease porting. Fix a handful of usages around qtbase, with at least a couple of them likely to be actual "sloppy" code. [ChangeLog][Potentially Source-Incompatible Changes][QFileInfo] Most QFileInfo constructors are now explicit. The QT_IMPLICIT_QFILEINFO_CONSTRUCTION macro is provided to keep old code working. Change-Id: Ic580e6316e67edbc840aa0c60d98c7aaabaf1af6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-152-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Fix a warning about deprecated conversion of keysFriedemann Kleint2020-11-121-1/+1
| | | | | | | | Use QKeyCombinaton::toCombined(). Change-Id: I829f4e88ad316a6f4f5165c1d929f2dcc83f83de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-122-8/+2
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cocoa: Allow CMD+H to hide the application when a tooltip is visibleAndy Shaw2020-11-101-1/+2
| | | | | | | | | | | Since native applications allow CMD+H to hide an application when the tooltip is visible then we should do too. Other popup windows will still block the call. Pick-to: 5.15 Fixes: QTBUG-82626 Change-Id: Ieac86d6b3cb2152a3ba82d8bd850f13bfeedb7c8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>