From e5078714febaa72bf2f43b3a8ac9caec1c324129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20=C3=96lmann?= Date: Mon, 14 Oct 2019 12:12:24 +0200 Subject: qlibinputtouch: bugfix: do not skip touch events Having a platform with Texas Instruments's ADS7846 touch screen controller (NXP i.MX6 DualLite SoC) and a LOGIC Technologies Inc. LTTD800x480 L2RT 7" (800x480 pixels) TFT LCD panel attached to it (resistive touch) using Linux v5.2.17 and libinput-1.12.6 a single one finger touch starts with a LIBINPUT_EVENT_TOUCH_ DOWN directly followed by a LIBINPUT_EVENT_TOUCH_MOTION both having the same touch position. Now Qt's code for touch input processing compressed both into one touch point with state Qt::TouchPointStationary which resulted in QGuiApplicationPrivate:: processTouchEvent() seeing no touch points with state Qt::TouchPointPressed anymore. As a consequence processTouchEvent()'s local container windowsNeeding- Events stayed empty and the whole touch frame was skipped. Fix this by still compressing into one touch point, but keeping its state as Qt::TouchPointPressed. Fixes: QTBUG-79212 Change-Id: Ia571d79ec5c1d6143e923ed69b378503b53e5992 Reviewed-by: Shawn Rutledge Reviewed-by: Laszlo Agocs --- src/platformsupport/input/libinput/qlibinputtouch.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp index a65bc91c39..ad85360b0e 100644 --- a/src/platformsupport/input/libinput/qlibinputtouch.cpp +++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp @@ -113,16 +113,16 @@ void QLibInputTouch::processTouchMotion(libinput_event_touch *e) DeviceState *state = deviceState(e); QWindowSystemInterface::TouchPoint *tp = state->point(slot); if (tp) { + Qt::TouchPointState tmpState = Qt::TouchPointMoved; const QPointF p = getPos(e); - if (tp->area.center() != p) { + if (tp->area.center() == p) + tmpState = Qt::TouchPointStationary; + else tp->area.moveCenter(p); - // 'down' may be followed by 'motion' within the same "frame". - // Handle this by compressing and keeping the Pressed state until the 'frame'. - if (tp->state != Qt::TouchPointPressed) - tp->state = Qt::TouchPointMoved; - } else { - tp->state = Qt::TouchPointStationary; - } + // 'down' may be followed by 'motion' within the same "frame". + // Handle this by compressing and keeping the Pressed state until the 'frame'. + if (tp->state != Qt::TouchPointPressed && tp->state != Qt::TouchPointReleased) + tp->state = tmpState; } else { qWarning("Inconsistent touch state (got 'motion' without 'down')"); } -- cgit v1.2.3 From 5771b5325b85f71a8f8ff78ed13eaee3df2e3ba8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 5 Nov 2019 22:10:24 +0100 Subject: syncqt: Add a means to suspend/resume the processing of a file Rather than tweaking the parser to cover every eventuality with corner case lines that could cause incorrect header files to be created then the means to suspend/resume the processing of a file is added. This enables us to have it skip over the template line that is causing a QList header to be created as part of the QtGui headers. This patch includes the fix to solve this in addition. Fixes: QTBUG-68129 Change-Id: I751646c4b20a4434347c149ae5e6dcb6e7618853 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 5 ++++- src/gui/kernel/qevent.h | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 8226edfb76..11ae5845eb 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -212,6 +212,7 @@ sub classNames { $$clean = 1; $$requires = ""; + my $suspended = 0; my $ihdrbase = basename($iheader); my $parsable = ""; @@ -224,9 +225,11 @@ sub classNames { $$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/); return @ret if($line =~ m/^#pragma qt_sync_stop_processing/); push(@ret, $1) if($line =~ m/^#pragma qt_class\(([^)]*)\)[\r\n]*$/); + $suspended = 1 if ($line =~ m/^#pragma qt_sync_suspend_processing/); + $suspended = 0 if ($line =~ m/^#pragma qt_sync_resume_processing/); $line = 0; } - if($line) { + if ($line && !$suspended) { $line =~ s,//.*$,,; #remove c++ comments $line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro $line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 2b1c6a6e31..0a8a1925e7 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -827,7 +827,14 @@ private: qint64 m_numericId; }; Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE); + +#if 0 +#pragma qt_sync_suspend_processing +#endif template <> class QList {}; // to prevent instantiation: use QVector instead +#if 0 +#pragma qt_sync_resume_processing +#endif Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW; inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW -- cgit v1.2.3 From 78ed3a12dbae70232711fd704e549ea0595ddd95 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 6 Nov 2019 14:31:23 +0100 Subject: Fix typo in QLoggingCategory documentation Change-Id: Id147e6f4c25a75eed5456390819f340d8d20172c Reviewed-by: Jesus Fernandez --- src/corelib/io/qloggingcategory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 89607d5a98..4a83780234 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -179,7 +179,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) The \c QtProject/qtlogging.ini file is looked up in all directories returned by QStandardPaths::GenericConfigLocation. - Set the \c QT_LOGGING_DEBUG environment variable to find out where you logging + Set the \c QT_LOGGING_DEBUG environment variable to find out where your logging rules are loaded from. \section2 Installing a Custom Filter -- cgit v1.2.3 From 3916b8a28bc9c55e10f4de611ed76e17017494aa Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 24 Oct 2019 08:34:46 +0200 Subject: iOS: Account for UITextInteraction when building against 12.x or lower MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In iOS 13.0 we can handle UITextInteraction as normal, but in lower versions it is not available to utilize at compile time. So we have to check for the other types instead and return if it is not one of those. Change-Id: Icbc5558e677ed40c03f30a174e2d79b87f489f68 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/quiview.mm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 4e3657ec37..91a186bace 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -628,17 +628,13 @@ 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 - } + if ([NSStringFromClass(interaction.class) isEqualToString:@"UITextInteraction"]) + return; [super addInteraction:interaction]; } -#endif @end -- cgit v1.2.3 From ef54abae43db79792b40dfdca30ac0fa1b582354 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Tue, 29 Oct 2019 20:42:00 +0100 Subject: Windows QPA: Fix missing update when the display is sleeping If an item was updated while the display was in sleep mode then when the display came back from sleep it would not be updated. This change detects when the display returns from sleep and repaints the windows to ensure the updated items are presented. Fixes: QTBUG-76307 Change-Id: I5fff5209e8a5c359d06ba1df61944690e9475ea6 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowscontext.cpp | 58 ++++++++++++++++++++++ src/plugins/platforms/windows/qwindowscontext.h | 2 + .../platforms/windows/qwindowsintegration.cpp | 2 + 3 files changed, 62 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 38b9823d6b..5c1b00a1c9 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -273,6 +273,8 @@ struct QWindowsContextPrivate { const HRESULT m_oleInitializeResult; QWindow *m_lastActiveWindow = nullptr; bool m_asyncExpose = false; + HPOWERNOTIFY m_powerNotification = nullptr; + HWND m_powerDummyWindow = nullptr; }; QWindowsContextPrivate::QWindowsContextPrivate() @@ -313,6 +315,13 @@ QWindowsContext::~QWindowsContext() #if QT_CONFIG(tabletevent) d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes. #endif + + if (d->m_powerNotification) + UnregisterPowerSettingNotification(d->m_powerNotification); + + if (d->m_powerDummyWindow) + DestroyWindow(d->m_powerDummyWindow); + unregisterWindowClasses(); if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE) OleUninitialize(); @@ -380,6 +389,55 @@ bool QWindowsContext::initPointer(unsigned integrationOptions) return true; } +extern "C" LRESULT QT_WIN_CALLBACK qWindowsPowerWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if (message != WM_POWERBROADCAST || wParam != PBT_POWERSETTINGCHANGE) + return DefWindowProc(hwnd, message, wParam, lParam); + + static bool initialized = false; // ignore the initial change + if (!initialized) { + initialized = true; + return DefWindowProc(hwnd, message, wParam, lParam); + } + + auto setting = reinterpret_cast(lParam); + if (setting) { + auto data = reinterpret_cast(&setting->Data); + if (*data == 1) { + // Repaint the windows when returning from sleeping display mode. + const auto tlw = QGuiApplication::topLevelWindows(); + for (auto w : tlw) { + if (w->isVisible() && w->windowState() != Qt::WindowMinimized) { + if (auto tw = QWindowsWindow::windowsWindowOf(w)) { + if (HWND hwnd = tw->handle()) { + InvalidateRect(hwnd, nullptr, false); + } + } + } + } + } + } + return DefWindowProc(hwnd, message, wParam, lParam); +} + +bool QWindowsContext::initPowerNotificationHandler() +{ + if (d->m_powerNotification) + return false; + + d->m_powerDummyWindow = createDummyWindow(QStringLiteral("QtPowerDummyWindow"), L"QtPowerDummyWindow", qWindowsPowerWindowProc); + if (!d->m_powerDummyWindow) + return false; + + d->m_powerNotification = RegisterPowerSettingNotification(d->m_powerDummyWindow, &GUID_MONITOR_POWER_ON, DEVICE_NOTIFY_WINDOW_HANDLE); + if (!d->m_powerNotification) { + DestroyWindow(d->m_powerDummyWindow); + d->m_powerDummyWindow = nullptr; + return false; + } + return true; +} + void QWindowsContext::setTabletAbsoluteRange(int a) { #if QT_CONFIG(tabletevent) diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index 4908f14629..04290379db 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -176,6 +176,8 @@ public: bool initTablet(unsigned integrationOptions); bool initPointer(unsigned integrationOptions); + bool initPowerNotificationHandler(); + int defaultDPI() const; QString registerWindowClass(const QWindow *w); diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 5c1fa00088..849e6cf2d0 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -256,6 +256,8 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL m_context.initTouch(m_options); QPlatformCursor::setCapability(QPlatformCursor::OverrideCursor); + + m_context.initPowerNotificationHandler(); } QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate() -- cgit v1.2.3 From 26f8adb1eefd1a8822413e036f2878b8cc1e7029 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Thu, 7 Nov 2019 16:52:10 +0100 Subject: Windows QPA: Avoid returning UI Automation ValueProvider for static text Static text controls should not return a ValueProvider. Otherwise, Narrator reads out static texts and announces whether they are editable or not, which is confusing to users. It should only read out the text itself. Fixes: QTBUG-79613 Change-Id: I080cd6a5db10f6f673b50c40ac7d87c3737d9b55 Reviewed-by: Friedemann Kleint --- .../platforms/windows/uiautomation/qwindowsuiamainprovider.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp index 5a05adbf81..96d64acc32 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp @@ -277,8 +277,9 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow } break; case UIA_ValuePatternId: - // All accessible controls return text(QAccessible::Value) (which may be empty). - *pRetVal = new QWindowsUiaValueProvider(id()); + // All non-static controls support the Value pattern. + if (accessible->role() != QAccessible::StaticText) + *pRetVal = new QWindowsUiaValueProvider(id()); break; case UIA_RangeValuePatternId: // Controls providing a numeric value within a range (e.g., sliders, scroll bars, dials). -- cgit v1.2.3 From 8ffb200153d1b1a8402c875c4961160efb149201 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 6 Nov 2019 11:23:12 +0100 Subject: Fix LTCG linker flags for macOS with separate debug info The linker must not throw away the lto.o file. We now instruct the linker to create a non-temporary lto.o, dependent on the target name. In order to do that we introduce a new mkspec variable QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO. This variable can contain single-$ variable references that get evaluated when loading ltcg.prf. Fixes: QTBUG-72846 Change-Id: I0ea882628d63e5406ba0ee68c7435af597364b0f Reviewed-by: Alexandru Croitor Reviewed-by: Edward Welbourne Reviewed-by: Kai Koehne --- mkspecs/common/clang-mac.conf | 1 + mkspecs/features/ltcg.prf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/mkspecs/common/clang-mac.conf b/mkspecs/common/clang-mac.conf index cbae2e6262..143406308c 100644 --- a/mkspecs/common/clang-mac.conf +++ b/mkspecs/common/clang-mac.conf @@ -5,6 +5,7 @@ QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT} QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0 +QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO = -Wl,-object_path_lto,${OBJECTS_DIR}/${TARGET}_lto.o QMAKE_CXXFLAGS += -stdlib=libc++ QMAKE_LFLAGS += -stdlib=libc++ diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf index a94f6d0eeb..5fa6309016 100644 --- a/mkspecs/features/ltcg.prf +++ b/mkspecs/features/ltcg.prf @@ -1,6 +1,12 @@ static:no-static-ltcg { # Static library but no-static-ltcg enabled: skip LTCG } else: CONFIG(release, debug|release) { + separate_debug_info { + # Evaluate single-$ variable references that have no valid value at mkspec loading time + QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO ~= s/\\$\\{/\$\$\{/ + eval(QMAKE_LFLAGS_LTCG += $$QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO) + } + # We need fat object files when creating static libraries on some platforms # so the linker will know to load a particular object from the library # in the first place. On others, we have special ar and nm to create the symbol -- cgit v1.2.3