Commit Graph

10596 Commits

Author SHA1 Message Date
Jøger Hansegård
55141c59cd Remove ambiguity in handling of registry keys from setupAPI.h
QWindowsScreen uses setupAPI.h's SetupDiOpenDevRegKey function to read
EDID data for monitors. This function is documented as returning
INVALID_HANDLE_VALUE in case of failure.

The QWindowsScreen code was ambiguous in the sense that it considered
both nullptr and INVALID_HANDLE_VALUE as being invalid handle values.
This inconsistency is likely not a bug, but makes the code harder to
understand.

This patch removes this ambiguity, and QWindowsScreen now follows the
documented behavior when SetupDiOpenDevRegKey fails. In addition, we
replace use of unique_ptr with the new QUniqueHandle template class
because HKEY is a handle type, not a regular pointer type.

Pick-to: 6.5 6.6
Change-Id: Ia863bda504077e59833f6f7a0f855e7915e4edd9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-17 23:29:00 +01:00
David Faure
923d09f3f1 QWindowsDrag: remove unused member variable and method isDragging
Change-Id: If2b10c31cb3d201395d121e6b20ac19e01128b2f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-11-17 23:00:10 +01:00
Wladimir Leuschner
f49d715e93 Fix visible state of QRadioButton in Windows11 style with animations off
Change-Id: I870afeb3330fcbe49ce6f16e847af23c3d91b74b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-17 22:32:24 +01:00
Liang Qi
25720f5a63 xcb: only set base size when it's valid
In rare situation, base size could be (-1,-1) or (-2,-2) for high
dpi, it will be converted into huge positive numbers.

https://tronche.com/gui/x/icccm/sec-4.html

If a base size is not provided, the minimum size is to be used
in its place and vice versa.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-117702
Change-Id: I900ed82f2291fb454d7e34a0dee27459d0a57240
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-17 22:32:24 +01:00
Tinja Paavoseppä
2198fc6a4a Android: Fix broken insertNativeView() signature
Method is trying to infer the signature from the types of the
arguments, but since the argument for the view is a plain jobject
this signature is wrong, method is not found and the view is never
inserted.

Change-Id: I3cbf9bccbcb1e5526f843213ba0f66e5bd1e7107
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-17 23:27:01 +02:00
Liang Qi
f2c5b846e0 xcb: update WM_TRANSIENT_FOR on transientParent native window recreation
It follows f9e4402ffe.

Fixes: QTBUG-105395
Pick-to: 6.6 6.5
Change-Id: I399c448517b7dbdc28ba33f75ae43102836a8998
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 14:34:16 +01:00
Liang Qi
5896314ff3 xcb: make QXcbWindow inherit QObject
Pick-to: 6.6 6.5
Change-Id: I418305f1e66bdf90b8bda724976916e320012961
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 14:34:16 +01:00
Volker Hilsheimer
f4c32f729c Cocoa: implement QScreen::orientation
Get the rotation value from the Core Graphics API, and map it to the
Qt::ScreenOrientation values.

Change-Id: I9bc9f37f34e00affee15e6ce0eace70d853eab0c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 02:55:10 +01:00
Morten Sørvig
6017695bfa Windows: Improve hidpi style drawing and metrics
Follow-up change from enabling DPI awareness, which
caused some style elements (for instance check boxes)
to be rendered incorrectly on non-primary displays,
when there is a difference in DPI between displays.

Use two approaches to get system metrics and themes:

* Use forDpi() API variants and query at 96 DPI for style
  metrics, that are in device independent pixels. These are
  metrics which are used for layout calculations.

* Get theme metrics at the target display DPI, and scale
  to device independent pixels when needed. This is used
  for OpenThemeData(), since this theme is used for drawing
  as well and needs to be in device pixels.

One approach is not used any more:

 * Get metrics for the main display, and scale by the ratio
   between the main and target display.

Change the theme cache to cache themes per window handle (HWND).
This is required since OpenThemeData() returns theme data for
a specific DPI, which means we can no longer use a shared
cache.

Clear the cache on theme change, DPI change, and when
the window is destroyed. This  handles cache invalidation
when the window is moved to a different screen, and also
when the DPI for a screen is changed.

Move the cache implementation to QWindowsStyleSupport
in QtGui, where it can be accessed by both the style and
windows platform plugins.

Task-number: QTBUG-110681
Change-Id: I5a4ff3a3753762bad8a51d08e51e8013bc7816a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-15 21:52:24 +01:00
Mårten Nordheim
5565ed24e1 qopenssl: fix accidental pessimization
The toLatin1 wasn't necessary, the argument should be QString.
The plugin isn't currently built with the ASCII ctors disabled,
so it passed through CI unnoticed.

Amends 3159b337f0

Pick-to: 6.6 6.5
Change-Id: Ib63ccaffacc46e5a313551f1e7c0e02ae09b1a01
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
c3a1fe7bd7 Prevent reparenting of foreign window embedding container
A foreign window used to embed a Qt window into it should not end up
with changes to its own parent, as its only job is to give the embedded
Qt window a parent handle.

Pick-to: 6.6
Change-Id: If1bc89658fedf449d266bc0cc750c90b6a841a68
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
0a0f7b864b macOS: Work around [NSApplication setWindowsMenu:] out of bound access
The implementation of [NSApplication setWindowsMenu:] seems to look
for the last item in the menu, but doesn't guard the check for the
menu having items. Instead it guards on another array being non-empty,
and in some situation this array has items of type NSWindowMenuItem
while our window menu is empty (FB13369198).

To work around this we insert a hidden dummy item into the menu.

Fixes: PYSIDE-2525
Pick-to: 6.5 6.6
Change-Id: Iaa9dbc9454249f4eb34f8a338d0cc23685f0025a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
189f9873ae macOS: Take window mask into account when computing QCocoaScreen::topLevelAt
Although not explicitly documented, this is the behavior in practice
on XCB and Windows, and we rely on this behavior in our implementation
of QApplication::widgetAt(), where we punch a temporary hole in the
widget using a mask if it has Qt::WA_TransparentForMouseEvents set.

Pick-to: 6.5 6.6
Fixes: QTBUG-41696
Task-number: QTBUG-119092
Change-Id: Ie7abc31b6930ee6b56fcdf391befc625c1ddf502
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-15 18:25:04 +01:00
Mårten Nordheim
668ce80e9e Schannel: change UNREACHABLE into error-handling
Because it happens in some (unknown precondition) cases.

While it would be nice to know what the client is doing to trigger this,
it's not worth crashing over in the meantime.

Fixes: QTBUG-118458
Pick-to: 6.6 6.5 6.2
Change-Id: I261a17578e7cd3a95e591a3228b33561000fd336
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 13:18:09 +02:00
Tor Arne Vestbø
cc4834c0b9 macOS: Always place input panels at NSPopUpMenuWindowLevel or above
Implementing NSTextInputClient.windowLevel to return the level of the
current input client window is not sufficient, as there may be other
windows visible with a higher window level than that.

For example, QCompleter's completion is shown using a Qt::Popup
window, which has a NSPopUpMenuWindowLevel.

Ideally we'd hide the QCompleter's completion when the IM is
in the process of compositing, but as a first step, and as
safeguard for other similar scenarios, we now return a minimum
window level of NSPopUpMenuWindowLevel for our text input
client.

Fixes: QTBUG-102831
Pick-to: 6.6 6.5 6.2
Change-Id: Id74a6350595bd136027a9af470f6700ee90f52a7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 03:15:22 -08:00
Michael Weghorn
f67499baab a11y uia: Report UIA_StrikethroughStyleAttributeId
Implement support for getting the strikethrough
style (UIA attribute UIA_StrikethroughStyleAttributeId [1])
by checking for the corresponding IAccessible2
text attribute "text-line-through-type" [2] and
mapping the value accordingly if set.

Only report those attributes from the
QAccessibleTextInterface::attributes return value,
if they apply for the whole range of the
QWindowsUiaTextRangeProvider.

With this in place, the NVDA screen reader on
Windows announces "strikethrough" as expected
when asked to report the formatting information
(e.g. via NVDA+f shortcut) for the QTBUG-118106 example.

[1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-textattribute-ids
[2] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes

Task-number: QTBUG-118106
Change-Id: I2fa060bd3bf493227bba766385f34d224497784c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-15 12:06:27 +01:00
Timur Pocheptsov
360152bdcd Cocoa plugin: make sure popups' collection behavior knows about spaces
It is possible to have several desktops on macOS, and even more - assign
an app to one particular desktop. Then, moving such an app to a different
desktop and using Qt's widgets like combobox may result in a strange
behavior: since it's not a native 'combo button', we create a popup
to show contents (list of items) of Qt's combobox and this popup
may open on a 'wrong' desktop (the one to which the app is assigned to).
To address this, combine the existing collection behavior for popups
with NSWindowCollectionBehaviorMoveToActiveSpace.

Pick-to: 6.6 6.5
Fixes: QTBUG-113507
Change-Id: Icbbc930fd1fc91089774340793e4bc452b939c1c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-15 11:02:42 +00:00
Michael Weghorn
bb6ed27b50 a11y uia: Map 3 more roles to UIA control type IDs
For QAccessible::Paragraph and QAccessible::Heading, use
UIA_TextControlTypeId as specified in the Core Accessibility
API Mappings specification [1] [2].

For QAccessible::WebDocument use UIA_DocumentControlTypeId.

[1] https://w3c.github.io/core-aam/#role-map-paragraph
[2] https://w3c.github.io/core-aam/#role-map-heading

Change-Id: Idae1e2da28b495d5d639df63c3de1260f2177142
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-15 03:28:36 +01:00
Wladimir Leuschner
77e0e7c414 Fix setting SysTrayIcon visible after explicitly hiding it
After hiding the QSystemTrayIcon explicitly with .setVisible(false)
resetting visibility with .setVisible(true) does not generate NIM_MODIFY
message and thus preventing the tray icon from being visible again.

Fixes: QTBUG-118133
Pick-to: 6.6 6.5
Change-Id: Ic2b1d0f293c92fec7ec697b2fe3d1da9fd0d0e44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
2023-11-14 15:19:40 +00:00
Michal Klocek
b63045477e Fix android build
Fix qt namespace issues:

* qjniarray.h:339:30: error: no template named 'Traits';
* ld.lld: error: version script assignment of 'Qt_6' to symbol '_ZNTestQTNamespace114QReadWriteLock16destroyRecursiveEP21QReadWriteLockPrivate' failed: symbol not defined
* same for _ZN16QNetworkDatagram7destroyEP23QNetworkDatagramPrivate
* qtimezoneprivate_android.cpp:14:21: error: unknown type name 'TimeZone'
* qandroidplatformclipboard.h:13:1: error: no template named 'Object'

Change-Id: Ia5fc3990af4a4d762e194c7951727f8d5b10670e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-14 15:54:38 +01:00
Tor Arne Vestbø
db33628452 Ensure foreign window can be reparented out of contained window again
A foreign window embedded into a Qt hierarchy must also support
being removed from that window hierarchy.

Pick-to: 6.6
Change-Id: Id4d08079ff19d67a8989937bc72602e8bd14b31b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-13 19:14:59 +01:00
Tor Arne Vestbø
93077dd1f2 iOS: Fix foreign window auto test
Pick-to: 6.6
Change-Id: Iae3a0f9805b02f935009d800dec00d9e2ceb008d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-13 19:14:59 +01:00
Tor Arne Vestbø
7a7aecae2a macOS: Clarify relation between occlusion state, hidden state, and expose
Pick-to: 6.5 6.6
Change-Id: I0e05332087fb3f876a9d2fadd9d7dcfd556d5734
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-12 18:40:03 +02:00
Tor Arne Vestbø
0366b554c9 macOS: Respect QPlatformDialogHelper::ButtonLayout in native alerts
The buttons in QMessageDialogOptions do not have any order that we
can rely on. The standard buttons is just a bit mask, so any ordering
done on the QMessageBox side is lost. The custom buttons are ordered
in the same order the user added them, but this is not really the
order we want them to appear in the dialog either, as we have a
well defined order between roles provided by QPlatformDialogHelper.

We now follow the QPlatformDialogHelper::ButtonLayout order for
macOS, using the same heuristics for multiple Accept role buttons
as QDialogButtonBox.

For buttons with the same role, QMessageBox will respect the order
they were added in, but this is not something we can do for the
standard buttons, as long as they are flattened to a bit mask.

Pick-to: 6.6 6.5
Change-Id: I401f202a7c2d83dc253e988531ad145624c97580
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-12 18:40:03 +02:00
Tor Arne Vestbø
b49211c125 macOS: Activate all windows on launch, not just key/main windows
The default macOS behavior when an application is activated is to
bring key and main windows to the front. Any window shown after
that is order to the front as normal.

For Qt apps we show windows in main() instead of waiting for the
application to become active first, and the request to show
the window may reach the window server before or after Finder
has made the application active. If it arrives first, the window
may end up behind the currently frontmost application.

This is particularly noticeable when the application is not
activated by Finder, and we do our own activation workaround.
In this case all our windows are hidden, except for the key
window.

To ensure a consistent behavior here, we explicitly activate
all windows of the application on launch.

Pick-to: 6.5 6.6
Change-Id: Ice55f7d03e077c5a5ca843f75f1a7296ebb47aa7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-12 18:40:03 +02:00
Tor Arne Vestbø
6343caae25 macOS: Only bring application forward on launch if needed
We override the macOS default behavior of not activating applications
unless they are launched from Finder. To play a bit nicer, we now
try to detect if we're already the frontmost application, and skip
the explicit activateIgnoringOtherApps if so.

Pick-to: 6.5 6.6
Change-Id: Iff4ddc3dc50aeb9700c88882dd7a270cfea5b737
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-12 18:40:02 +02:00
Tor Arne Vestbø
b8879b4d2d macOS: Remove dead code for activating application on startup
We handle this in applicationDidFinishLaunching nowadays.

Pick-to: 6.5 6.6
Change-Id: I447e8923fba3eac4cb0a2727f369fff21054f9a1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-12 18:40:02 +02:00
Ws ShawnWoo
709d2848e1 macOS: Implement NSTextInputClient.windowLevel
Without this optional NSTextInputClient method the input methods
will assume it's safe to place the input panel somewhere above
NSFloatingWindowLevel.

But our NSWindow level can potentially be higher than that, if
set via QWindow::setFlags(), or directly on the NSWindow.

In practice this can be observed by setting a level higher
than kCGDockWindowLevel on the NSWindow.

Account for this by returning the true window level.

Pick-to: 6.6 6.5 6.2
Change-Id: I77d9ac3c59e2f6de9b768c7519b2bc0f1e5fda1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-12 08:40:02 -08:00
Tor Arne Vestbø
cb94e360ec macOS: Work around key view loop crossing NSWindow boundaries
AppKit will in some cases set up the key view loop for child views, even
if we don't set autorecalculatesKeyViewLoop, nor call recalculateKeyViewLoop
ourselves.

When a child window is promoted to a top level, AppKit will maintain the key
view loop between the views, even if these views now cross NSWindows, even
after we explicitly call recalculateKeyViewLoop. When the top level is then
hidden, AppKit will complain when -[NSView _setHidden:setNeedsDisplay:] tries
to transfer first responder by reading the nextValidKeyView, and it turns out
to live in a different window.

  ERROR: Setting <View: 0x145e0cfd0> as the first responder for window
  <Window: 0x10f904de0>, but it is in a different window (<Window: 0x147104f00>)!
  This would eventually crash when the view is freed. The first responder will
  be set to nil.

We mitigate this by a last second reset of the first responder, which is
what AppKit also falls back to.

It's unclear if the original situation of views having their nextKeyView
pointing to views in other windows is kosher or not, but that's left for
further investigations.

Pick-to: 6.5 6.6
Change-Id: I63636afbba85abf73a38db9701f32656c42c59cc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-12 17:40:02 +01:00
Vladimir Belyavsky
5b451efe81 QCocoaSystemTrayIcon: fix updateMenu() logic
Amends da754d5b65
We should avoid registering an observer multiple times for the same
NSMenu object, because it results in multiple consecutive
emitActivated() calls.

So,
- bail out early if menu is the same, i.e. we have nothing to do
- unregister an observer we added previously for the old menu

Fixes: QTBUG-119053
Pick-to: 6.6 6.5
Change-Id: I14fce693dba351b1d12f2140fa8e672227cc7a9e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-12 13:36:05 +00:00
Assam Boudjelthia
2f706df651 Android: set the default theme directly in QtActivity without reflection
Currently the default theme is looked for using reflection in the
android.R package to get an id and then it's set. This is not needed
if we set the theme directly in the user's QtActivity which would have
access to that id directly pre-deployment.

To make setting a theme more in line with Android, retreat to using
setTheme() call directly for user projects instead of having to maintain
some internal field to store the theme name and have the user set that
if they want a different theme for their app.

Also, the Android plugin seems to set an env var for QT_ANDROID_THEME
with that default theme's name and that's used in QAndroidPlatformTheme
to check a theme specific extracted theme style.json, however, the Java
side doesn't seem to ever write to such a path, making this approach
totally redundant. For that reason, this code path is now removed.

Fixes: QTBUG-114075
Task-number: QTBUG-115017
Task-number: QTBUG-114593
Change-Id: I9ab3c025626aac2c09bc19eb7d846eca14a45070
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-10 21:57:11 +02:00
Assam Boudjelthia
f5e2302851 Android: don't call delegates outside of the Activity
The delegate classes shouldn't be used outside of the Activity/Service
classes, since they're practically private implementation, so don't use
them anywhere outside Activity/Service.

Since Qt Android apps still mainly support having one QtActivity/
QtService, QtNative heavily uses those objects to do various operations.
For that reason, we still need to use the delegate there. The aim is
to change that in future patches and do the operations where they make
more sense for example directly under QtActivityBase/QtActivityDelegate
or Service counterpart.

The QtServiceDelegate is used no where and have no special
implementation, so it's removed here.

Task-number: QTBUG-118077
Change-Id: I5e106318169be19fec8163e8e500ee573af0e1bc
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-10 21:57:11 +02:00
Liang Qi
f84e654a62 xcb: fix deprecated QBitmap::operator=(const QPixmap&) warnings
Pick-to: 6.6 6.5 6.2
Change-Id: I2caa64d92ece20d5c8d650a3898926e8f0fa7b24
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-10 19:02:14 +00:00
Volker Hilsheimer
8753bb3045 Cocoa MessageBox: don't use native message box if detailed text is set
As per the documentation: A message box displays a primary
text to alert the user to a situation, an informative text to
further explain the situation, and an optional detailed text to provide
even more data if the user requests it.

The AppKit NSAlert doesn't provide such a "detailed" section, and our
code just added this "even more data" detailed text to the primary text.

This breaks the UI when the detailed text is very long, perhaps a
complete log output with dozens or even hundreds of lines of text.

Since NSAlert doesn't provide a "details" space, fall-back to the non-
native message box if detailed text is provided.

[ChangeLog][QtWidgets][QMessageBox] On Apple platforms, the native
message box is no longer used when detailed text is set.

Pick-to: 6.6 6.5
Fixes: QTBUG-118992
Change-Id: I6f4764ceb8f8e57d641c0b0660223a9c26f5bd26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-10 11:20:56 +02:00
Shawn Rutledge
68369237bf iOS: Make nextTouchId static, unsigned and let it overflow
If an application has two windows, and the user tries to do multi-touch
gestures with different fingers in each window at the same time, we want
the touchpoint IDs to be unique. m_nextTouchId was a per-window variable
before; the result was that the QEventPoint delivered to the second
window was replacing values (including QEventPointPrivate::window)
in the persistent QEventPoint that was still being held in the first
window; then when the release of the first point occurred,
QGuiApplicationPrivate::processTouchEvent() saw its destination window
pointer as null because the second touchpoint had already been released.

QEventPoint::id is of type int, with negative values being invalid.
nextTouchId is of type quint16 so that it will always be positive, and
we can let it eventually overflow (wrap back to 0) rather than resetting
it to 0 after each touch gesture. The only requirement is that the IDs
need to be unique and positive (and typically they are sequential: that
makes debug output easier to understand).

Task-number: QTBUG-118909
Change-Id: Ia0f1edc9a5e2b362028bed4418fed228814cddb6
Pick-to: 6.5 6.6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-09 12:10:52 -08:00
Friedemann Kleint
78512135c8 Windows QPA: Fix wheel events when using -platform windows:reverse
Wheel events in WM_POINTER messages use global coordinates.
Move the code doing the RTL correction into the local coordinates branch.

Fixes: QTBUG-117499
Task-number: QTBUG-28463
Pick-to: 6.6 6.5
Change-Id: I10e965da9e9660985eaa2681fcf780b5388299a2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
2023-11-09 15:59:41 +01:00
Timur Pocheptsov
3159b337f0 Openssl V3: try to work around the lack of SHLIB_VERSION_NUMBER
It's no more defined in opensslv.h, try to use OPENSSL_SHLIB_VERSION
instead.

Pick-to: 6.6 6.5
Fixes: QTBUG-116295
Change-Id: Ie465f4147e0ec95897bd8d35f71241884bf64b4e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-11-08 18:24:17 +01:00
Friedemann Kleint
01d55f0203 Windows QPA: Emit QGuiApplication::primaryScreenChanged()
Patch as contributed.

Pick-to: 6.6 6.5
Fixes: QTBUG-93368
Change-Id: I8cc884e64e84128b125415e78e3a34245ae4e626
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2023-11-08 18:21:30 +01:00
Alexey Edelev
a8118caad6 Remove forward declared QHash
Fixes the complication issue since the typedef was used as class member.
Replace the typedef with using statement.

Fixes: QTBUG-118627
Pick-to: 6.6 6.5
Change-Id: Ie3d341fb8f18a7341d018f51947127ace941a620
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-06 22:44:35 +01:00
Assam Boudjelthia
0f3dbd6dc7 Android: remove a11y methods from QtNative, call a11y delegate direct
Remove yet another two layers of delegation, QtNative calling
QtActivityDelegate and that in turn calls QtAccessibilityDelegate.
Now from c++ native code, acquire the a11y delegate and use it to
call a11y operations that live in QtAccessibilityDelegate.

Task-number: QTBUG-118077
Change-Id: I9e84520c2caa281a6f786a687b0106d702f92a67
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-06 19:59:51 +02:00
Mårten Nordheim
3ea46fa978 Schannel: Return if socket is invalid
In a couple places we already check if the socket is connected,
however we can be connected _and_ have the socket be closed.
The logic behind that I don't really understand, but there are
similar checks for validity in the OpenSSL backend.

This happens when calling close() on a still-connecting
socket. The QIODevice is marked as closed, but the connection
cannot yet be aborted. And when it finishes connecting we
handle the signal, start encryption, and then disconnect.

Pick-to: 6.6 6.5
Fixes: QTBUG-116550
Change-Id: I06c0a2db32bea0b573a99a971b8fb0b66a7a73d5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-06 18:23:19 +01:00
Mårten Nordheim
c31227a548 QNetworkInfo[win]: Advertise Metered feature
I forgot to add this to the features list when adding support for it.

Amends d2c5494c3d

Pick-to: 6.6 6.5
Fixes: QTBUG-118741
Change-Id: Ieabf086ef66777e6178476934b88448ad88bc738
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-06 18:23:19 +01:00
Tim Jenssen
91fe6fb2e1 Schannel: Avoid crashing for unparsed certificate
Crash reports imply the `certBackend` we extract in
QSslCertificate_from_CERT_CONTEXT is null, which means that
something went wrong when parsing the certificate data we get from
the certificate chain.
We assume the rest is okay since it must be inside the bounds of the
length of the chain.

It's not clear why the certificate would be invalid, but it's better
to avoid the crash for now.

Pick-to: 6.5 6.6
Task-number: QTBUG-118569
Change-Id: I76ce07fc38bf82ef5c93097d839724ddee1edeef
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-03 23:30:16 +01:00
Wladimir Leuschner
5165a5802c Introduce dark mode to QWindows11Style
Introduce dark mode to QWindows11Style and increase frame contrast on
highcontrast themes.

Change-Id: I18d10a314fb11828b8c3a116396e2d3cd2247b65
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-03 18:27:13 +01:00
Assam Boudjelthia
742f45f7cf JNI: pass same QJniEnvironment object to QAndroidPlatformClipboard
... registerNatives() call.

Change-Id: I42539846249880ed4a215522bdcafb3a2ffa4d14
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-02 21:46:32 +02:00
Assam Boudjelthia
58c7249ee8 Android: move display and screen management to new QtDisplayManager
Have all or most of Android code dealing with displays in
QtDisplayManager. Also, simplify setApplicationDisplayMetrics()
call and avoid caching any uneccessary members.

Task-number: QTBUG-118077
Change-Id: I943069c24bb40ae3016db5896e553b501e700a6b
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-02 16:13:22 +02:00
Bartlomiej Moskal
d10d76f9f2 Android: Hide text handle when it is out or covered
The text handle should not be visible in case when it is out of
the text-object, or when it is hidden by other object. That is why we
should call updateSelectionHandles() method after touch only in case
when cursor position fits to clipped input item rectangle.

Fixes: QTBUG-115005
Pick-to: 6.6 6.5
Change-Id: I35c083acd8fd4d5240e3bb15afa1afbec4ea0b26
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-02 10:16:32 +01:00
Mike Chen
9161f66a49 xcb: unset states and set new ones as need
Should not unset all the old state and set the new ones.
Only unset the state that needs to be unset.

If states changes from maximized to minimized, there is no need to
unset the maximized state and set the maximized states again.
(minimized and maximized can exist simultaneously :)

This amends f61b140482 .

Pick-to: 6.6 6.5 6.2
Change-Id: Ic93122b92fafcdba973b885e299b282408da7a1c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-11-02 05:59:49 +00:00
Liang Qi
78272c667f xcb: implement QXcbCursor::size()
A follow up of baed8534bc .

Fixes: QTBUG-118612
Pick-to: 6.6 6.5 6.2
Change-Id: I7b4a2276c6e6a14d5413f6cd64d801de11cc8c3e
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-01 23:52:23 +01:00
Volker Hilsheimer
daf15a4aaf Android: clean up error handling and native methods registration
Emit log output and return false immediately if we fail to get both the
Activity and the Service objects. Standardize the registerNative methods
to return bool and take a QJniEnvironment, and adjust the macros
accordingly.

Simplify the startup routine to use QJniEnvironment.

Change-Id: I11be35426520dc803f5a07bbb495e908592f254e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-01 15:58:45 +08:00