From 1f6bd8bfb2206480ca5b5c267da38659e6cff20e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 22 Feb 2018 15:02:52 +0100 Subject: Windows QPA: Ensure a mouse release event is sent after DnD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows does not send a mouse release by itself, which can leave Quick controls believing the mouse is still pressed. Synthesize an event. Task-number: QTBUG-66447 Change-Id: Ia865edddc0c77a1b42b9ad2c38323379e74b6704 Reviewed-by: Jan Arve Sæther --- src/plugins/platforms/windows/qwindowsdrag.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp index 777c45ae86..db06f81434 100644 --- a/src/plugins/platforms/windows/qwindowsdrag.cpp +++ b/src/plugins/platforms/windows/qwindowsdrag.cpp @@ -248,6 +248,7 @@ private: Mode m_mode; QWindowsDrag *m_drag; + QPointer m_windowUnderMouse; Qt::MouseButtons m_currentButtons; ActionCursorMap m_cursors; QWindowsDragCursorWindow *m_touchDragWindow; @@ -260,6 +261,7 @@ private: QWindowsOleDropSource::QWindowsOleDropSource(QWindowsDrag *drag) : m_mode(QWindowsCursor::cursorState() != QWindowsCursor::CursorSuppressed ? MouseDrag : TouchDrag) , m_drag(drag) + , m_windowUnderMouse(QWindowsContext::instance()->windowUnderMouse()) , m_currentButtons(Qt::NoButton) , m_touchDragWindow(0) { @@ -400,7 +402,19 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) case DRAGDROP_S_DROP: case DRAGDROP_S_CANCEL: QGuiApplicationPrivate::modifier_buttons = toQtKeyboardModifiers(grfKeyState); - QGuiApplicationPrivate::mouse_buttons = buttons; + if (buttons != QGuiApplicationPrivate::mouse_buttons) { + if (m_windowUnderMouse.isNull() || m_mode == TouchDrag || fEscapePressed == TRUE) { + QGuiApplicationPrivate::mouse_buttons = buttons; + } else { + // QTBUG 66447: Synthesize a mouse release to the window under mouse at + // start of the DnD operation as Windows does not send any. + const QPoint globalPos = QWindowsCursor::mousePosition(); + const QPoint localPos = m_windowUnderMouse->handle()->mapFromGlobal(globalPos); + QWindowSystemInterface::handleMouseEvent(m_windowUnderMouse.data(), + QPointF(localPos), QPointF(globalPos), + QWindowsMouseHandler::queryMouseButtons()); + } + } m_currentButtons = Qt::NoButton; break; -- cgit v1.2.3 From 2eec3272c78a3af1e362906654aa6d50b33a4c50 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 26 Feb 2018 15:57:55 +0200 Subject: Make qWaitForWindowActive more robust Based on the information we got from Unity developers, we need to check for window's frame geometry to be set, not just window's position to be set. On various window managers, a window is 'ready' once the frame geometry is set. This fixes autotest flakiness of tests that use qWaitForWindowActive. Task-number: QTBUG-66216 Change-Id: Icb664e7b802b474919f3b058c00681574522ccbe Reviewed-by: Simon Hausmann --- src/testlib/qtestsystem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index 79fe68004e..046fe1a3e7 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -114,7 +114,7 @@ namespace QTest { bool becameActive = qWaitFor([&]() { return window->isActive(); }, timeout); - // Try ensuring the platform window receives the real position. + // Try ensuring the platform window receives the real position and geometry. // (i.e. that window->pos() reflects reality) // isActive() ( == FocusIn in case of X) does not guarantee this. It seems some WMs randomly // send the final ConfigureNotify (the one with the non-bogus 0,0 position) after the FocusIn. @@ -122,7 +122,7 @@ namespace QTest // qWaitForWindowShown() will generate bogus results. if (becameActive) { int waitNo = 0; // 0, 0 might be a valid position after all, so do not wait for ever - while (window->position().isNull()) { + while (window->frameGeometry().isNull()) { if (waitNo++ > timeout / 10) break; qWait(10); -- cgit v1.2.3 From 00f89d61b91d38917e3ecbdf213b36974702ce6a Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Tue, 27 Feb 2018 11:28:50 +0200 Subject: Widen the blacklists for flaky udp tests Task-number: QTBUG-66216 Change-Id: I52688bf41ef12b2ec67887b1a5d26f89d4556d5b Reviewed-by: Friedemann Kleint Reviewed-by: Simon Hausmann Reviewed-by: Kari Oikarinen --- tests/auto/network/socket/qudpsocket/BLACKLIST | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST index a98c4d5c6b..0d56f6c827 100644 --- a/tests/auto/network/socket/qudpsocket/BLACKLIST +++ b/tests/auto/network/socket/qudpsocket/BLACKLIST @@ -21,6 +21,6 @@ osx [zeroLengthDatagram] osx [linkLocalIPv6] -redhatenterpriselinuxworkstation-6.6 +linux [readyReadForEmptyDatagram] -ubuntu-16.04 +linux -- cgit v1.2.3 From 7eac2e7350f8831a7d79085897496f9373284d3d Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Tue, 27 Feb 2018 15:15:34 +0200 Subject: Silence a GCC 8 warning in evdevtablet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtbase/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp:85:36: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct QEvdevTabletData::’; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&state, 0, sizeof(state)); Change-Id: I3b18ffa7fdf9c7aa1bd4977f12858fd1f176c020 Reviewed-by: Friedemann Kleint --- src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp index dbab2f6a24..b6051aaf3c 100644 --- a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp +++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp @@ -82,7 +82,7 @@ QEvdevTabletData::QEvdevTabletData(QEvdevTabletHandler *q_ptr) { memset(&minValues, 0, sizeof(minValues)); memset(&maxValues, 0, sizeof(maxValues)); - memset(&state, 0, sizeof(state)); + memset(static_cast(&state), 0, sizeof(state)); } void QEvdevTabletData::processInputEvent(input_event *ev) -- cgit v1.2.3 From 1b72d3e645a41c7b7f7731cecbd7119b8e7f7f28 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Tue, 27 Feb 2018 15:28:18 +0200 Subject: Silence a GCC 8 warning in qxcbnativeinterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtbase/src/plugins/platforms/xcb/qxcbnativeinterface.cpp:309:65: error: cast between incompatible function types from ‘void (*)(const char*)’ to ‘QPlatformNativeInterface::NativeResourceForIntegrationFunction’ {aka ‘void* (*)()’} [-Werror=cast-function-type] return NativeResourceForIntegrationFunction(setStartupId); Change-Id: I83409b3a6cc67ccb4c9e91e592e6a01bb6ce45ea Reviewed-by: Friedemann Kleint --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 22d90d6ac2..db44e58cbb 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -306,13 +306,13 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa return func; if (lowerCaseResource == "setstartupid") - return NativeResourceForIntegrationFunction(setStartupId); + return NativeResourceForIntegrationFunction(reinterpret_cast(setStartupId)); if (lowerCaseResource == "generatepeekerid") - return NativeResourceForIntegrationFunction(generatePeekerId); + return NativeResourceForIntegrationFunction(reinterpret_cast(generatePeekerId)); if (lowerCaseResource == "removepeekerid") - return NativeResourceForIntegrationFunction(removePeekerId); + return NativeResourceForIntegrationFunction(reinterpret_cast(removePeekerId)); if (lowerCaseResource == "peekeventqueue") - return NativeResourceForIntegrationFunction(peekEventQueue); + return NativeResourceForIntegrationFunction(reinterpret_cast(peekEventQueue)); return 0; } @@ -334,9 +334,9 @@ QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::n return func; if (lowerCaseResource == "setapptime") - return NativeResourceForScreenFunction(setAppTime); + return NativeResourceForScreenFunction(reinterpret_cast(setAppTime)); else if (lowerCaseResource == "setappusertime") - return NativeResourceForScreenFunction(setAppUserTime); + return NativeResourceForScreenFunction(reinterpret_cast(setAppUserTime)); return 0; } @@ -388,7 +388,7 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio } if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier()) - return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(QXcbScreen::virtualDesktopNumberStatic)); + return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(reinterpret_cast(QXcbScreen::virtualDesktopNumberStatic))); return nullptr; } -- cgit v1.2.3 From a8aa3dc5c71ffeaafd0df60cfabf2779cf4daadc Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 27 Feb 2018 14:10:50 +0100 Subject: QDate/Time,QTimeZone: Fix empty documentation section titles Change-Id: I674c4bb1805a7f7bc95512b07b0278446ebe7772 Reviewed-by: Martin Smith --- src/corelib/tools/qdatetime.cpp | 7 +++---- src/corelib/tools/qtimezone.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index df5e4e44e4..49e7173de0 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -357,7 +357,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_ there are in this date's month and year, respectively. The isLeapYear() function indicates whether a date is in a leap year. - \section1 + \section1 Remarks \section2 No Year 0 @@ -3047,7 +3047,7 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT \note QDateTime does not account for leap seconds. - \section1 + \section1 Remarks \section2 No Year 0 @@ -3065,8 +3065,7 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT extreme values that you do not overflow the storage. The exact range of supported values varies depending on the Qt::TimeSpec and time zone. - \section2 - Use of System Timezone + \section2 Use of System Timezone QDateTime uses the system's time zone information to determine the offset of local time from UTC. If the system is not configured diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index 65c304bcf7..daa7dc1531 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -139,7 +139,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz); \note For consistency with QDateTime, QTimeZone does not account for leap seconds. - \section1 + \section1 Remarks \section2 IANA Time Zone IDs -- cgit v1.2.3 From eba652a99f602386127e552740fddf5445b3d7c9 Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Tue, 27 Feb 2018 18:38:35 +0200 Subject: Blacklist tst_QNetworkReply::ioHttpRedirectPolicy Has been failing a lot lately Task-number: QTBUG-66247 Change-Id: Id940a573eb299379cacceb836890cbe0b3c896b7 Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/qnetworkreply/BLACKLIST | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST index 0b691ada83..fab8224431 100644 --- a/tests/auto/network/access/qnetworkreply/BLACKLIST +++ b/tests/auto/network/access/qnetworkreply/BLACKLIST @@ -24,9 +24,9 @@ windows # QTBUG-66602 [ioHttpRedirectMultipartPost] * +# QTBUG-66247 [ioHttpRedirectPolicy] -b2qt 64bit -linux +* [ioHttpRedirectPostPut] linux windows -- cgit v1.2.3