From e2203163d9cd03165142d98fa9ba8aaf5a9c3085 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jul 2014 16:57:27 +0200 Subject: Windows: Send QTabletLeaveProximity events. Proximity leave comes without packets, do not bail out. Task-number: QTBUG-40019 Change-Id: I4e6b4ca13ad875bdfdcd31f86b08de4a596e76cb Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowstabletsupport.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 2a1e5c58b9..8ceab02311 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. @@ -347,7 +347,13 @@ QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(const quint64 uniqueI bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, LPARAM lParam) { - const bool enteredProximity = LOWORD(lParam) != 0; + if (!LOWORD(lParam)) { + qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice; + QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice, + m_devices.at(m_currentDevice).currentPointerType, + m_devices.at(m_currentDevice).uniqueId); + return true; + } PACKET proximityBuffer[1]; // we are only interested in the first packet in this case const int totalPacks = QWindowsTabletSupport::m_winTab32DLL.wTPacketsGet(m_context, 1, proximityBuffer); if (!totalPacks) @@ -367,17 +373,11 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L m_devices.push_back(tabletInit(uniqueId, cursorType)); } m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor); - qCDebug(lcQpaTablet) << __FUNCTION__ << (enteredProximity ? "enter" : "leave") - << " proximity for device #" << m_currentDevice << m_devices.at(m_currentDevice); - if (enteredProximity) { - QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice, - m_devices.at(m_currentDevice).currentPointerType, - m_devices.at(m_currentDevice).uniqueId); - } else { - QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice, - m_devices.at(m_currentDevice).currentPointerType, - m_devices.at(m_currentDevice).uniqueId); - } + qCDebug(lcQpaTablet) << "enter proximity for device #" + << m_currentDevice << m_devices.at(m_currentDevice); + QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice, + m_devices.at(m_currentDevice).currentPointerType, + m_devices.at(m_currentDevice).uniqueId); return true; } -- cgit v1.2.3 From ae99f83312e2785cae280d4d7474050e163b7328 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Jul 2014 13:55:30 +0200 Subject: Windows: Fix window geometry when transiting from fullscreen to maximized. The workaround added for QTBUG-8361 also needs to trigger in the restore-from-fullscreen logic, set flag accordingly. Task-number: QTBUG-40254 Task-number: QTBUG-8361 Change-Id: I6d6c35bb7004c84c6b8feea05ad974c23ca205d2 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index cdc0b24464..7d04c99d16 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1696,8 +1696,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) if (!wasSync) clearFlag(SynchronousGeometryChangeEvent); // preserve maximized state - if (visible) + if (visible) { + setFlag(WithinMaximize); ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE); + clearFlag(WithinMaximize); + } m_savedStyle = 0; m_savedFrameGeometry = QRect(); } -- cgit v1.2.3