From 69f0cfbb9c609ac922a6d45a7ef3d75b59d23c25 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 6 Nov 2009 17:19:40 +0100 Subject: Dont create native winid when not required. When Windows doesn't support native gestures, we shouldn't create a native winid. Also, there is no reason to create winid on all ancestors. Reviewed-by: Trond --- src/gui/kernel/qwidget_win.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 22a94b9..95ef1cf 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -2033,9 +2033,12 @@ void QWidgetPrivate::registerTouchWindow() void QWidgetPrivate::winSetupGestures() { Q_Q(QWidget); - if (!q || !q->isVisible()) + if (!q || !q->isVisible() || !nativeGesturePanEnabled) return; + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); + if (!qAppPriv->SetGestureConfig) + return; WId winid = q->internalWinId(); bool needh = false; @@ -2052,10 +2055,12 @@ void QWidgetPrivate::winSetupGestures() needv = (vbarpolicy == Qt::ScrollBarAlwaysOn || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum())); singleFingerPanEnabled = asa->d_func()->singleFingerPanEnabled; - if (!winid) + if (!winid) { + q->setAttribute(Qt::WA_DontCreateNativeAncestors); winid = q->winId(); // enforces the native winid on the viewport + } } - if (winid && qAppPriv->SetGestureConfig) { + if (winid) { GESTURECONFIG gc[1]; memset(gc, 0, sizeof(gc)); gc[0].dwID = GID_PAN; -- cgit v0.12