summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* macOS: Correctly compute marked and selected text range, and use for insertionTor Arne Vestbø2021-08-241-17/+111
| | | | | | | | | | | | | | | | | | | The NSTextInputClient protocol expects marked (composed) and selected text ranges to be relative to the document, not to the current editing block as Qt typically expects. Luckily we can use the absolute cursor position to compute an absolute offset that we can apply to any other positions, such as the selection. Now that we are computing the ranges correctly we can also use them during text insertion, when the incoming replacementRange is not valid. We then transform and sanitize the replacement range to the format that Qt expects for QInputMethodEvent::setCommitString(). Pick-to: 6.2 Change-Id: I4cb2f7c63adb92e407f38af05adce539c9bed7e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Highlight selected part of preedit using platform theme paletteTor Arne Vestbø2021-08-231-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | QInputMethodEvent::Selection unfortunately doesn't apply to the preedit text, and QInputMethodEvent::Cursor which does, doesn't support setting a selection. Until we've introduced attributes that allow us to propagate the preedit selection semantically we resort to styling the selection via the TextFormat attribute, so that the preedit selection is visible to the user. This allows us to remove the fallback we had for thick and double underline styles, where we mapped those to the wiggly underline style. This was needed to distinguish the selected cluster when composing CJK, but looked out of place. One disadvantage of faking the selection via text format is that we will not update the selection color on theme change, e.g. when switching from light to dark mode, but this is a minor issue that we can live with until we've introduced a proper QInputMethodEvent attribute for the preedit selection. Pick-to: 6.2 Change-Id: I1c45c310107697962e328a4db908d29d2358f756 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Handle more NSUnderlineStyles during text compositionTor Arne Vestbø2021-08-211-2/+22
| | | | | | Pick-to: 6.2 Change-Id: I2a6cf612506d19736eab007f687a03f6d6595b62 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Respect default marked text attributesTor Arne Vestbø2021-08-211-31/+37
| | | | | | | | | | | | | | | | | | | | When the marked text was not an attributed string with built in styling we used to fall back to a hard-coded underline style. We now pick up the default marked text style via the markedTextAttributes property of a temporarily created NSView, which by default is a yellow background color. The implementation in NSView respects text system configuration toggles such as NSMarkedTextAttribute and NSMarkedTextColor, so by setting the user default NSMarkedTextAttribute to "Underline" the marked text will look like our old hard-coded default. This can be done in many ways, including passing `-NSMarkedTextAttribute Underline` on the command line, or by QSettings::setValue("NSMarkedTextAttribute", "Underline"); Pick-to: 6.2 Change-Id: Iede74836ed1449e77018c13733a675f8e9d84f7d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Clean up code style in [QNSView setMarkedText:]Tor Arne Vestbø2021-08-211-23/+23
| | | | | | Pick-to: 6.2 Change-Id: I8a901ac81b64e6fc9bd7fe9ea4e3eaa6257118ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Ensure we provide a preedit format for non-attributed stringsTor Arne Vestbø2021-08-211-3/+1
| | | | | | | | | | The logic was not taking into account that we were always adding an QInputMethodEvent::Cursor attribute, so we would never hit the fallback code. Pick-to: 6.2 Change-Id: I25bd725025152241a55e3fea60444c20e27db4f9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Simplify validAttributesForMarkedTextTor Arne Vestbø2021-08-211-10/+1
| | | | | | | | | | We don't need to condition this on IM enablement. The attributes are only used if we are actually marking text, which only happens for IM enabled views. Pick-to: 6.2 Change-Id: I47377cf53cf2bf44a1d9513d317f82c73f083fa3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Correct QNSPanelContentsWrapper @end marker placementTor Arne Vestbø2021-08-201-1/+2
| | | | | | | | | The incorrect "scoping" of q_IOObjectRetain and q_IOObjectRelease luckily did not affect their functionality as QIOType helpers. Pick-to: 6.2 Change-Id: I9b9c2312464c7e6f8e2d2a5856e35efa99ec0c41 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QCocoaTheme: add ButtonText color to standard paletteRichard Moe Gustavsen2021-08-201-1/+2
| | | | | | | | | | | | | | | | The standard palette had no value set for ButtonText. The result was the we drew button text in QtQuickControls2 using Text color instead, which would be wrong in dark mode, and result in a dark color instead of white. Note: Widgets hardcode the color "white" directly in the mac style, and was not affected by the missing value. Fixes: QTBUG-89177 Pick-to: 6.2 6.1 Change-Id: Ie2d99bfac9fcc70d45e5bd40ea45becf3fd70d87 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Check for correct "Access Denied" errorMorten Sørvig2021-08-201-2/+2
| | | | | | | | | | | SetProcessDpiAwarenessContext() returns ERROR_ACCESS_DENIED if the DPI awareness has already been set, and not E_ACCESSDENIED like SetProcessDpiAwareness() does. Pick-to: 6.2 Change-Id: I6b29214773776f31c0622a35494d98c5c9637b0b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* macOS: close popups on mousedown within the window frameVolker Hilsheimer2021-08-193-34/+53
| | | | | | | | | | | | | | | | On macOS, we close active popups when handling mouse-down events in the NSView, but not for such events in the window frame. This allows users to close a window that has a context menu open via the window's close button, which then leaves open popups behind. Factor the popup-closing code out into a dedicated method that we can call from within the NSWindow::sendEvent implementation for mouse down events. Fixes: QTBUG-30522 Pick-to: 6.2 6.1 5.15 Change-Id: I9c354efc449cfefff3ed84fa34b1cd8a0da3b4a7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Expand QNSView complex text documentationTor Arne Vestbø2021-08-191-1/+58
| | | | | | Pick-to: 6.2 Change-Id: Iceb146d7aafb869a80cebe50e27c3bc98e67ebe1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Tweak method argument names in QNSView complex text implementationTor Arne Vestbø2021-08-191-19/+19
| | | | | | Pick-to: 6.2 Change-Id: I6a7ec683ffe9c18a89326b3e53b4a907cb9a9512 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Restructure QNSView complex text implementationTor Arne Vestbø2021-08-191-85/+89
| | | | | | | | | For better overview of the flow and functionality of the NSTextInputClient protocol. Pick-to: 6.2 Change-Id: I8658405c7ff4ae762bfe3e4c11f9a157ae2b9a09 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Reorder QNSView instance variablesTor Arne Vestbø2021-08-191-14/+23
| | | | | | Pick-to: 6.2 Change-Id: Icde9ee6744290f88eaa2ac197c40ba412543b122 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Update QCocoaInputContext documentationTor Arne Vestbø2021-08-191-6/+4
| | | | | | Pick-to: 6.2 Change-Id: I5ae5fe51ddc1512f2627dbc972fbb95360d7ea24 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Implement QPlatformInputContext::setFocusObject()Tor Arne Vestbø2021-08-192-13/+3
| | | | | | | | Instead of handling the update manually. Pick-to: 6.2 Change-Id: Iffb28d893146f5d3f6eae8e8c43aaf7fa5281516 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Add some logging to QCocoaInputContextTor Arne Vestbø2021-08-191-2/+4
| | | | | | Pick-to: 6.2 Change-Id: I8e28cdaf89e8b741a5047f00016e17b8916edece Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Fix member variable name in QCocoaInputContextTor Arne Vestbø2021-08-192-8/+8
| | | | | | Pick-to: 6.2 Change-Id: I7e61df4e6afbfd7e962499f0cfca5739658244dd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Handle input source change notifications in QCocoaInputContextTor Arne Vestbø2021-08-196-26/+26
| | | | | | | | Instead of going via QNSView. Also add some logging. Pick-to: 6.2 Change-Id: Iabed7511572ef22597651efa8047f06227b28533 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Simplify string handling when handling complex textTor Arne Vestbø2021-08-191-18/+8
| | | | | | Pick-to: 6.2 Change-Id: Ib19dab99b836fdd5a5eda5cc54c81f1fea31ce65 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Use helper method for querying input method parametersTor Arne Vestbø2021-08-194-105/+101
| | | | | | Pick-to: 6.2 Change-Id: I379d4ca20101899db2dfbd8f0c5a22f423e40d6b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: support setting environment againMorten Johan Sørvig2021-08-191-1/+1
| | | | | | | | After enabling -s MODULARIZE=1 there is no longer a global ENV. Use module.ENV instead. Change-Id: Ic6958f52c6ceb7014f7f2c78a73f2bce5a43bf41 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: add DialogExec hack back with warningMorten Sørvig2021-08-191-0/+10
| | | | | | | | | | | | | | | Previously, this was implemented in QEventLoop. By moving it to the event dispatcher we can target the warning message better and provide a suggested workaround for the dialog case. The behavior is the same as before: call emscripten_sleep(), which throws a Javascript exception and returns control to the browser while leaking the content of the stack. Pick-to: 6.2 Change-Id: I2979fe4fe5923c27713e85b6725614b60a693e93 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* MySQL: pedantism: create and destroy the MYSQL_TIME typeThiago Macieira2021-08-181-3/+7
| | | | | | | | This is a no-op. But take the opportunity to make a drive-by update on the loop, which improves it. Change-Id: I4a40ccbd3321467a8429fffd169b08590d28c928 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* MySQL: implement binding output (SELECT) results to MYSQL_TIMEThiago Macieira2021-08-181-0/+23
| | | | | | | We already do it for inputs but weren't doing it for outputs. Change-Id: I4a40ccbd3321467a8429fffd169afeb5730ad75e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* CMake: Fix wasm top-level prefix buildsAlexandru Croitor2021-08-181-7/+12
| | | | | | | | | | | The wasm support files need to be both copied and installed in a top-level prefix build, to ensure that leaf repos can find them in the build dir when they are configured. Pick-to: 6.2 Fixes: QTBUG-95806 Change-Id: I8c09f04fec51cf850299d535bdf3f26542ec4aac Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* MySQL: don't allocate 1-byte buffers for BLOBsThiago Macieira2021-08-171-1/+1
| | | | | | | | | We set the buffer length to 0 for blobs, as we need to do it for each row, in bindBlobs() (apparently a workaround for MySQL 4.1.8 API). That function was deleting the buffer and reallocating. Change-Id: I4a40ccbd3321467a8429fffd169b06422612ca13 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* MySQL: treat the MYSQL_FIELD as read-onlyThiago Macieira2021-08-171-14/+13
| | | | | | | | | | | | | | | | | | The MariaDB-connector-c version 3.2 and MariaDB server version 10.6 cooperate to avoid re-transferring the query metadata, so the fact that we were modifying it was causing it to improperly decode the DATETIME data types into string, as we had asked. We ended up with a 7-byte string that was actually the date binary-encoded. References: - https://jira.mariadb.org/browse/MDEV-26271 - https://github.com/MythTV/mythtv/issues/373 - https://bugs.kde.org/show_bug.cgi?id=440296 Pick-to: 5.12 5.15 6.2 Fixes: QTBUG-95639 Change-Id: I4a40ccbd3321467a8429fffd169afdbb26cf29f6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* MySQL: remove left-over charset-setting codeThiago Macieira2021-08-171-7/+0
| | | | | | | | Complements commit 472520afb9081856a2556c7df221c084a42a2d42. We were doing it twice. Change-Id: I4a40ccbd3321467a8429fffd169b05fa5e22f204 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* macOS: Don't wipe NSWindowStyleMaskFullSizeContentView if set manuallyTor Arne Vestbø2021-08-171-1/+3
| | | | | | | | | | The NSWindow may have style masks set by the user via winId(). We don't want to wipe those just because we're recomputing the style mask. Fixes: QTBUG-69975 Pick-to: 6.2 6.1 5.15 Change-Id: Ibca8388d45b623f4cdfaff4b256c4eb012e2ffac Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Add logging for keyboard and complex text inputTor Arne Vestbø2021-08-164-9/+63
| | | | | | Pick-to: 6.2 Change-Id: I098829e051d4f63950b2e35ee6dd4def8d70cf01 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix Style java code format and warningsAssam Boudjelthia2021-08-152-27/+2
| | | | | | | | | | | The code had many bad formating and syntax or API usage warnings, as well as some unused methods or classes which are fixed with this patch. Pick-to: 6.2 5.15 6.1 Task-number: QTBUG-71590 Change-Id: Ib113a0dc05703afb5190ec880b27daf75274cb1e Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* CMake: Fix plugin target names to end in Plugin suffixAlexandru Croitor2021-08-121-2/+3
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95731 Change-Id: I56a34dd26656613c95fbc8f081d39561cb691852 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* MySQL: properly fix setting the character setThiago Macieira2021-08-101-3/+31
| | | | | | | | | | | | | | | Commit e4bd73dc54542fe16121825c2a369b7f863e0de8 moved the mysql_set_character_set() call above the mysql_real_connect() but that doesn't actually work, as there's no connection to send the "SET NAMES" statement on. So do it in two steps: first, by setting the charset in the MYSQL structure, then by asking the server to match. Pick-to: 6.2 Task-number: QTBUG-55444 Change-Id: I4a40ccbd3321467a8429fffd1699bd829f342124 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* MySQL: don't format QDateTime with timezonesThiago Macieira2021-08-101-0/+14
| | | | | | | | | | | | | | | | | | | | | Neither MySQL nor MariaDB like it. According to the documentation[1], MySQL now accepts timezones using the [+-]HH:MM format (and -00:00 is rejected). MariaDB does not accept timezones at all[2]. This has apparently been broken since Qt 5.0 (the "Z" suffix was introduced in commit 2528f4ffe53dfbd640249f63497522929264f3d7), but this issue was never noticed because the of prepared queries: when they're in use, we transfer the time using a MYSQL_TIME structure, which does not support timezone offsets either. We've only noticed this issue when the code to determine if the MySQL client library supported prepared statements broke. [1] https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html [2] https://mariadb.com/kb/en/date-and-time-literals/ Task-number: QTBUG-95071 Change-Id: I4a40ccbd3321467a8429fffd1699cc4c050ae746 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* MySQL: remove the version number checks in favor of actual functionalityThiago Macieira2021-08-101-2/+15
| | | | | | | | | | | | | | | | | | | | | MariaDB library version 3.2 no longer returns the server version in the 10.x range but the library version itself, which is lower than 4.x. That meant we concluded the server did not support prepared statements. And because of the lack of prepared statements, all QDateTime conversions failed, because of the timezone. I don't know if this was intended or what, but it's a side issue. [ChangeLog][QtSql][MySQL] Fixed the detection of whether the client and server support prepared statements. This was caused by the mariadb connector library reporting its own version numbers (starting in version 3.2) instead of the server version. Fixes: QTBUG-95071 Pick-to: 5.15 6.2 Change-Id: I4a40ccbd3321467a8429fffd1699bc089ba706e6 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de>
* xcb: implement missing bits from ICCCM 4.1.4 WM_STATE handlingGatis Paeglis2021-08-102-12/+119
| | | | | | | | | | | | | | | | | | | | ICCCM 4.1.4 says: Clients that want to re-use a client window (e.g. by mapping it again) after withdrawing it must wait for the withdrawal to be complete before proceeding. The preferred method for doing this is for clients to wait for a windown manager to update or remove the WM_STATE property. This patch implements the required logic. Qt 4 had something similar. Without this patch we are calling various setter functions on a native window while it is in an undefined state. Fixes: QTBUG-69515 Pick-to: 6.2 5.15 Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I377a66ad3d5e43f14465d0ea670b2f43f96ed7d3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* xcb: add a timeout control when reading INCR propertyLiang Qi2021-08-101-2/+6
| | | | | | | | | | | | | | | | | | | For the first call of QXcbClipboard::clipboardReadProperty() inside of clipboardReadIncrementalProperty() in getSelection(), it will get a XCB_NONE reply before the contents arrived via property change. Then we give a chance to read more. Manually tested with following setups: * examples/widgets/mainwindows/application with gvim(gtk3) * examples/widgets/widgets/imageviewer with GIMP 2.10.18(based on gtk2) and GIMP 2.99.6(based on gtk3 via flatpak) Fixes: QTBUG-56595 Pick-to: 5.12 5.15 6.1 6.2 Done-With: JiDe Zhang <zhangjide@uniontech.com> Change-Id: Ib45f08464d39ad79137b1da99808c89b7dca2d08 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Fix leaked NSMutableArray in applicationActivationChangedTor Arne Vestbø2021-08-081-1/+1
| | | | | | | | | The +[NSObject new] method is a combination of alloc and init. Fixes: QTBUG-95619 Pick-to: 6.2 6.1 5.15 Change-Id: I341f8a3958fb7a016cf4c346750ea6d46eeebe9f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Rename qt6_add_plugin TYPE option to PLUGIN_TYPEAlexandru Croitor2021-08-0660-60/+60
| | | | | | | | | | | | | 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>
* Add native interface for X11 application, exposing display and connectionTor Arne Vestbø2021-08-062-11/+15
| | | | | | | | | | | | | | | | | | | | | The major use-case of the now private QX11Info from Qt X11 Extras was getting hold of the Xlib display and XCB connection, for example in KDE: https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=QX11Info A new native interface for QGuiApplication has now been added that exposes these two properties, e.g.: if (auto *x11App = app.nativeInterface<QX11Application>()) qDebug() << x11App->display() << x11App->connection(); To avoid type clashes one of the enum values of QXcbNativeInterface's ResourceType had to be renamed. Pick-to: 6.2 Task-number: QTBUG-93633 Change-Id: I2e366a2bb88bd3965ac6172ad000ae32209f43e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve WM_DPICHANGED handlingMorten Johan Sørvig2021-08-063-52/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resize QPlatformWindow on DPI change, so that QWindow size can stay approximately constant. For example, a 100x100 QWindow at 100% scaling will have a 100x100 QPlatformWindow. If the scaling is changed to 200% then the QPlatformWindow is resized to 200x200, while the size of the QWindow stays at at 100x100. In practice the QWindow size will also change slightly, due to inaccuracies in how we adjust for the size of the non-client window area. This will be addressed in a later commit. We can get DPI change independently of screen change, so no resizing should happen in screen change events. Disable the resize code in QGuiApplication for Q_OS_WIN, and remove the WithinDpiChanged flag. The new flow for handling DPI change is: 1) Send screen change (if any), so that the correct screen will be used when calculating scale factors during the following resize. 2) Resize the native window, which will trigger geometry change events, possibly also for the QWindow. 3) Resize child windows; WM_DPICHANGED is sent to top-level windows only. Fixes: QTBUG-89294 Pick-to: 6.2 Change-Id: I0e2d44bae72d20ebdafc3d410db7be9964ad851b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Track current window DPIMorten Johan Sørvig2021-08-064-0/+15
| | | | | | | | | | The WM_DPICHANGED event gives us the new DPI, but we also need the current DPI in order to determine the scale factor corresponding to the DPI change. Pick-to: 6.2 Change-Id: Ia61388415f57aa739397d3125b8751952e8fd392 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Shift iOS a11y translations into C++ fileMike Achtelik2021-08-044-1/+122
| | | | | | | | | | | lupdate cannot parse .mm files. Therefore tr markup must be inside of C++ files. This copies the same approach qtconnectivity uses, see 6b2fd04b7be4494767b6092a030607010d91310c Pick-to: 6.2 Change-Id: I9853864b4b81b48da763a387c78c102857f23047 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix PerMonitorV2 DPI aware NonCLientAreaScaling handlingMorten Johan Sørvig2021-08-021-3/+10
| | | | | | | | | | | | | | | | | | | | | | The value returned from shouldHaveNonClientDpiScaling() controls two related behaviors: 1) Should Qt call user32dll.enableNonClientDpiScaling() 2) Should Qt code treat NonClientAreaScaling as enabled. Commit c35643db updated shouldHaveNonClientDpiScaling() to account for the fact that PerMonitorV2 always enables NonCLientAreaScaling, with the intent to disable 1) However this also disables 2), which was not intended. Instead, make shouldHaveNonClientDpiScaling() always return true when PerMonitorV2 is enabled, and then also omit calling the user32dll API in this case. Change-Id: I1d06f36a3d06becc667351fadcb00ab28af6ec4b Pick-to: 6.2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* macOS: Stop relying on balanced CGDisplay reconfiguration callbacksTor Arne Vestbø2021-08-023-84/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using CGDisplay callbacks to determine when a screen reconfiguration had happened, and when it had propagated to changes in NSScreen.screens, so that we could update our QScreen view of the world. Unfortunately the CGDisplay callbacks were not deterministic enough to use as a signal for when a reconfigure had completed. Since we can't rely on NSApplicationDidChangeScreenParametersNotification either (it comes in too late), we're now resorting to updating our QScreens at every chance we get: - On every CGDisplay reconfiguration ending - On QCocoaWindow::windowDidChangeScreen() as a result of AppKit moving the window. - On NSApplicationDidChangeScreenParametersNotification - On QCocoaScreen::get() as a last resort Since the result of these updates are only reflected as QScreen property updates or QGuiApplication signals if a change actually occurred, it should be safe to update early and often. Task-number: QTBUG-77656 Fixes: QTBUG-80193 Pick-to: 6.2 6.1 5.15 Change-Id: I98334a66767736d94ad2fcb169e65f0d8bc71a30 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* CMake: Bump project versionsAlexandru Croitor2021-08-021-1/+1
| | | | | | Fixes: QTBUG-95454 Change-Id: I2467d3ae27b54424e59a7a4ab00d364eaec517d5 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Register mouse devices on cocoaShawn Rutledge2021-08-015-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It would have been nice to ensure that a device is registered already in mouseEnteredImpl(); but in that context, NSEvent.deviceID is always 0, and we can't find out anything else about the device. QWindowSystemInterface::handleEnterEvent() doesn't currently take a QPointingDevice either. In handleMouseEvent() and scrollWheel(), deviceID seems unique for each trackpad or Magic Mouse, but 0 for any plain USB mouse. There, the first mouse that the user interacts with becomes primaryPointingDevice(): its deviceID is assigned to systemID (except if deviceID == 0, we use 1 instead, to avoid the auto-incrementing device ID assignment in the QInputDevicePrivate ctor.) When scrolling occurs, we update the capabilities to have PixelScroll if theEvent.hasPreciseScrollingDeltas. So over time, QInputDevice::devices() should build up to a complete list, with capabilities() also distinguishing plain mice from those that have the PixelScroll capability. And in the common case that the user has only one Apple pointing device, it becomes primaryPointingDevice(). Pick-to: 6.2 Task-number: QTBUG-46412 Task-number: QTBUG-63363 Task-number: QTBUG-72167 Change-Id: Id9771b4dfd765e49023bd57d42a2aa4d0635a3b2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove Windows 7, 8, and 8.1 codepathsOliver Wolff2021-07-302-32/+10
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-84432 Change-Id: I970d7d7e9ebdcf246a5be32d60066b4e5e948c27 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>