diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-09-05 13:39:25 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-10 14:09:45 +0200 |
commit | 1ea00124f77df1753b3d881810bbed181bbc6fc6 (patch) | |
tree | 65e487e74ad0023dc7d9ec89a97329e467d69ded /src/plugins/platforms/windows/qwindowswindow.h | |
parent | b625ff4c7b68505b6d299d688734c9c1d448cb80 (diff) |
Windows: Implement automatic mouse capture in QPA.
Qt expects the mouse to be captured on any button press
until release.
Remove flags to store capture, use WinAPI GetCapture() instead.
Remove setMouseGrabEnabled_sys(), streamline code.
Replacement for the reverted change
6b5bbc531b30d8ece25425e39843c6ae1af1d045 for QTBUG-25977.
Task-number: QTBUG-27132
Task-number: QTBUG-27039
Task-number: QTBUG-25977
Task-number: QTBUG-26962
Change-Id: If86428eabfadcafd16da10f134a419f833185272
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 35790e2739..2bcca8710f 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -126,7 +126,8 @@ public: SizeGripOperation = 0x100, FrameStrutEventsEnabled = 0x200, SynchronousGeometryChangeEvent = 0x400, - WithinSetStyle = 0x800 + WithinSetStyle = 0x800, + AutoMouseCapture = 0x1000 //! Automatic mouse capture on button press. }; struct WindowData @@ -179,6 +180,7 @@ public: virtual bool setKeyboardGrabEnabled(bool grab); virtual bool setMouseGrabEnabled(bool grab); + inline bool hasMouseCapture() const { return GetCapture() == m_data.hwnd; } virtual bool startSystemResize(const QPoint &pos, Qt::Corner corner); @@ -249,7 +251,6 @@ private: inline bool isFullScreen_sys() const; inline void setWindowState_sys(Qt::WindowState newState); inline void setParent_sys(const QPlatformWindow *parent) const; - inline void setMouseGrabEnabled_sys(bool grab); void destroyWindow(); void registerDropSite(); void unregisterDropSite(); @@ -261,7 +262,6 @@ private: HDC m_hdc; Qt::WindowState m_windowState; qreal m_opacity; - bool m_mouseGrab; QWindowsWindowCursor m_cursor; QWindowsOleDropTarget *m_dropTarget; unsigned m_savedStyle; |