summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowspointerhandler.cpp
diff options
context:
space:
mode:
authorOliver Wolff <[email protected]>2024-06-05 09:20:03 +0200
committerOliver Wolff <[email protected]>2024-06-12 16:21:30 +0000
commit3a38de71da13103fbe5bdf6b822263e282e68368 (patch)
treedb9fd2044abbc4670e90d434faf5e798dc9ca15c /src/plugins/platforms/windows/qwindowspointerhandler.cpp
parent0e6907d2f0e95a8892df55e075837cc0e81e0f3f (diff)
Windows: Remove legacy mouse handling
Pointer handling API was added in Windows 8. As we no longer support Windows 7, we can make mouse handling code easier to read/maintain be removing the legacy implementation. [ChangeLog][Windows] Legacy mouse handling has been removed. It is no longer possible to enforce legacy mouse handling by passing "-nowmpointer". Pick-to: 6.8 Change-Id: I58387471999a371fd20c644abbcf855e192d220b Reviewed-by: Tor Arne Vestbø <[email protected]>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowspointerhandler.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index 71c72176710..7995716444a 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -4,7 +4,6 @@
#include <QtCore/qt_windows.h>
#include "qwindowspointerhandler.h"
-#include "qwindowsmousehandler.h"
#if QT_CONFIG(tabletevent)
# include "qwindowstabletsupport.h"
#endif
@@ -39,6 +38,14 @@ enum {
qint64 QWindowsPointerHandler::m_nextInputDeviceId = 1;
+const QPointingDevice *primaryMouse()
+{
+ static QPointer<const QPointingDevice> result;
+ if (!result)
+ result = QPointingDevice::primaryPointingDevice();
+ return result;
+}
+
QWindowsPointerHandler::~QWindowsPointerHandler()
{
}
@@ -215,7 +222,7 @@ static Qt::MouseButtons mouseButtonsFromKeyState(WPARAM keyState)
return result;
}
-static Qt::MouseButtons queryMouseButtons()
+Qt::MouseButtons QWindowsPointerHandler::queryMouseButtons()
{
Qt::MouseButtons result = Qt::NoButton;
const bool mouseSwapped = GetSystemMetrics(SM_SWAPBUTTON);
@@ -785,7 +792,7 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window,
}
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized;
- const QPointingDevice *device = QWindowsMouseHandler::primaryMouse();
+ const QPointingDevice *device = primaryMouse();
// Following the logic of the old mouse handler, only events synthesized
// for touch screen are marked as such. On some systems, using the bit 7 of