From 32f1e151cb66da08b8c7578b0701408fcb009ea2 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 5 Aug 2009 18:02:48 +0200 Subject: Small fix for native gestures on windows. We should close the gestureinfo handle only we managed to open successfully. Reviewed-by: trustme --- src/gui/kernel/qapplication_win.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 3177cc1..6421ed9 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -3716,13 +3716,8 @@ bool QETWidget::translateCloseEvent(const MSG &) bool QETWidget::translateGestureEvent(const MSG &msg) { GESTUREINFO gi; + memset(&gi, 0, sizeof(GESTUREINFO)); gi.cbSize = sizeof(GESTUREINFO); - gi.dwFlags = 0; - gi.ptsLocation.x = 0; - gi.ptsLocation.y = 0; - gi.dwID = 0; - gi.dwInstanceID = 0; - gi.dwSequenceID = 0; QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); @@ -3756,6 +3751,7 @@ bool QETWidget::translateGestureEvent(const MSG &msg) default: break; } + qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam); if (event.gestureType != QNativeGestureEvent::None) qt_sendSpontaneousEvent(widget, &event); } else { @@ -3763,7 +3759,6 @@ bool QETWidget::translateGestureEvent(const MSG &msg) if (dwErr > 0) qWarning() << "translateGestureEvent: error = " << dwErr; } - qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam); return true; } -- cgit v0.12