From e00d888daefbfbd5f17e0772421773f8e295087b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 2 Oct 2019 15:03:35 +0200 Subject: iOS: Prevent UIKit from adding UITextInteraction to our view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's added automatically when some languages such as Japanese are the active input language/keyboard, which results in UIKit triggering the edit menu for any tap in the UI, regardless of whether it hits the focus object or not. Adopting the protocol is a much larger effort and needs to be coordinated so that we still support text interaction on iOS versions pre 13.0. Even with this patch the UITextSelectionView will still blink its own cursor, which doesn't seem to sync up with the UITextInput protocol's view of where the cursor is. Fixes: QTBUG-78496 Change-Id: I61500ad7ab9c8577f71188c0c99ead39465e3839 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/quiview.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index e64c05d099..4e3657ec37 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -628,6 +628,18 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") #endif } +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000) +- (void)addInteraction:(id)interaction +{ + if (__builtin_available(iOS 13.0, *)) { + if ([interaction isKindOfClass:UITextInteraction.class]) + return; // Prevent iOS from adding UITextInteraction + } + + [super addInteraction:interaction]; +} +#endif + @end @implementation UIView (QtHelpers) -- cgit v1.2.3 From b7aaee002677caf411190bbc6ea7f18a28a71360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 7 Oct 2019 16:56:19 +0200 Subject: iOS: Remove assert when doing GL rendering in the background MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-76961 Change-Id: If2212601dbb867dd7ceb826b867bb24d302f86df Reviewed-by: Volker Hilsheimer Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioscontext.mm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index 535e7d7aa6..cecbb17039 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -332,11 +332,8 @@ bool QIOSContext::verifyGraphicsHardwareAvailability() ); }); - if (applicationBackgrounded) { - static const char warning[] = "OpenGL ES calls are not allowed while an application is backgrounded"; - Q_ASSERT_X(!applicationBackgrounded, "QIOSContext", warning); - qCWarning(lcQpaGLContext, warning); - } + if (applicationBackgrounded) + qCWarning(lcQpaGLContext, "OpenGL ES calls are not allowed while an application is backgrounded"); return !applicationBackgrounded; } -- cgit v1.2.3 From 631efee29371246ba1a1d9d007b23ca08b867191 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 16 Oct 2019 12:35:11 +0200 Subject: iOS: Account for when the older SDK is used when building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the pre-built versions of Qt at this point are still built against the iOS 12.x SDKs, then we need to account for this in order to have the workaround implemented in e00d888daefbfbd5f17e0772421773f8e295087b still working when deployed to an iOS 13 based device. Change-Id: I649a453c549ee272de64624d68f9382276fcba64 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/quiview.h | 5 +++++ src/plugins/platforms/ios/quiview.mm | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/ios/quiview.h b/src/plugins/platforms/ios/quiview.h index e1d5d5af0c..343f102971 100644 --- a/src/plugins/platforms/ios/quiview.h +++ b/src/plugins/platforms/ios/quiview.h @@ -70,3 +70,8 @@ QT_END_NAMESPACE @property (nonatomic, readonly) UIEdgeInsets qt_safeAreaInsets; @end +#if !QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000) +@interface UITextInteraction : NSObject +@end +#endif + diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 4e3657ec37..962b1d929f 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -628,7 +628,6 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") #endif } -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000) - (void)addInteraction:(id)interaction { if (__builtin_available(iOS 13.0, *)) { @@ -638,7 +637,6 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") [super addInteraction:interaction]; } -#endif @end -- cgit v1.2.3 From a7a24784eeba6747d319eb911583bdd99ef38cdb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 25 Oct 2019 06:57:32 +0000 Subject: Revert "iOS: Account for when the older SDK is used when building" This reverts commit 631efee29371246ba1a1d9d007b23ca08b867191. Reason for revert: This causes a problem when running on iOS 11 devices. Change-Id: If5194989b8d7a9f4cf2d72e770fdaad754d7e236 Reviewed-by: Jani Heikkinen --- src/plugins/platforms/ios/quiview.h | 5 ----- src/plugins/platforms/ios/quiview.mm | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/ios/quiview.h b/src/plugins/platforms/ios/quiview.h index 343f102971..e1d5d5af0c 100644 --- a/src/plugins/platforms/ios/quiview.h +++ b/src/plugins/platforms/ios/quiview.h @@ -70,8 +70,3 @@ QT_END_NAMESPACE @property (nonatomic, readonly) UIEdgeInsets qt_safeAreaInsets; @end -#if !QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000) -@interface UITextInteraction : NSObject -@end -#endif - diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 962b1d929f..4e3657ec37 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -628,6 +628,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") #endif } +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000) - (void)addInteraction:(id)interaction { if (__builtin_available(iOS 13.0, *)) { @@ -637,6 +638,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") [super addInteraction:interaction]; } +#endif @end -- cgit v1.2.3 From be73bdc5d2491d036e5a6334dada453ed808dbc0 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 18 Oct 2019 12:28:13 +0200 Subject: Only call ShowCaret if Windows 10 1709 or later is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This amends cc873ec23a98ac32d10ac5fa569792fde2f6b2c8 which worked around a problem that was showing up on earlier versions of Windows. This extends the workaround up to Windows 10 1703 as the problem was still occurring up to that version. Fixes: QTBUG-79143 Change-Id: Ib7eace17fb8e3817c556e2bcd462e37834b1cbcf Reviewed-by: Friedemann Kleint Reviewed-by: André de la Rocha --- src/plugins/platforms/windows/qwindowsinputcontext.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index 8054f9fe83..bbfad7d712 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -280,13 +280,15 @@ void QWindowsInputContext::showInputPanel() // with Windows 10 if the Windows IME is (re)enabled _after_ the caret is shown. if (m_caretCreated) { cursorRectChanged(); - // We only call ShowCaret() on Windows 10 as in earlier versions the caret - // would actually be visible (QTBUG-74492) and the workaround for the - // Surface seems unnecessary there anyway. But leave it hidden for IME. - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10) + // We only call ShowCaret() on Windows 10 after 1703 as in earlier versions + // the caret would actually be visible (QTBUG-74492) and the workaround for + // the Surface seems unnecessary there anyway. But leave it hidden for IME. + if (QOperatingSystemVersion::current() >= + QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 16299)) { ShowCaret(platformWindow->handle()); - else + } else { HideCaret(platformWindow->handle()); + } setWindowsImeEnabled(platformWindow, false); setWindowsImeEnabled(platformWindow, true); } -- cgit v1.2.3 From 26f9cb7ce5a81eac9743d0dd183f59ceb7e73569 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 17 Oct 2019 08:43:49 +1000 Subject: wasm: take canvas offset into account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes issue with dialogs when the canvas is not at 0,0 in the browser window Change-Id: I14f6754746e064921635d6b3af3353bf3620ac44 Fixes: QTBUG-79160 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmscreen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp index e536bc0ee3..37f1ea832a 100644 --- a/src/plugins/platforms/wasm/qwasmscreen.cpp +++ b/src/plugins/platforms/wasm/qwasmscreen.cpp @@ -186,8 +186,12 @@ void QWasmScreen::updateQScreenAndCanvasRenderSize() canvas.set("width", canvasSize.width()); canvas.set("height", canvasSize.height()); + QPoint offset; + offset.setX(emscripten::val::global(canvasId.constData())["offsetTop"].as()); + offset.setY(emscripten::val::global(canvasId.constData())["offsetLeft"].as()); + emscripten::val rect = canvas.call("getBoundingClientRect"); - QPoint position(rect["left"].as(), rect["top"].as()); + QPoint position(rect["left"].as() - offset.x(), rect["top"].as() - offset.y()); setGeometry(QRect(position, cssSize.toSize())); m_compositor->redrawWindowContent(); -- cgit v1.2.3 From 39ed657b6393c850735857e367303800f1a04413 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 21 Oct 2019 10:23:27 +0200 Subject: Query the mouse buttons initially in case the middle button was used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I99a3ef598bdaaba1afb6bf6521d1ceafcc9b603c Reviewed-by: André de la Rocha --- src/plugins/platforms/windows/qwindowspointerhandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp index 71a09304c5..fae01c9147 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp +++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp @@ -579,7 +579,9 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin const QTabletEvent::TabletDevice device = QTabletEvent::Stylus; QTabletEvent::PointerType type; - Qt::MouseButtons mouseButtons; + // Since it may be the middle button, so if the checks fail then it should + // be set to Middle if it was used. + Qt::MouseButtons mouseButtons = queryMouseButtons(); const bool pointerInContact = IS_POINTER_INCONTACT_WPARAM(msg.wParam); if (pointerInContact) -- cgit v1.2.3 From 7f0aaa88ef1db3840bd504d63a38d53032b8f802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 27 Oct 2019 18:57:56 +0100 Subject: macOS: Only skip screen reconfigure if primary screen changed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia5d208ace5086e8e92f95f859383773894a18768 Reviewed-by: Timur Pocheptsov (cherry picked from commit dcbe25bbbb603bc335d7cf0982a80293289b0d8f) Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoascreen.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm index 392099d083..16b11b3835 100644 --- a/src/plugins/platforms/cocoa/qcocoascreen.mm +++ b/src/plugins/platforms/cocoa/qcocoascreen.mm @@ -93,11 +93,10 @@ void QCocoaScreen::initializeScreens() mainDisplay->updateProperties(); qCInfo(lcQpaScreen) << "Primary screen changed to" << mainDisplay; QWindowSystemInterface::handlePrimaryScreenChanged(mainDisplay); + if (cocoaScreen == mainDisplay) + return; // Already reconfigured } - if (cocoaScreen == mainDisplay) - return; // Already reconfigured - cocoaScreen->updateProperties(); qCInfo(lcQpaScreen) << "Reconfigured" << cocoaScreen; } -- cgit v1.2.3