diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-06 16:19:40 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-06 16:43:24 (GMT) |
commit | 69f0cfbb9c609ac922a6d45a7ef3d75b59d23c25 (patch) | |
tree | 1a0187a0df02b95f3200d3c8b7a531ee530efa70 /src | |
parent | f8f589b00248d1c56db696b16576486525893e8d (diff) | |
download | Qt-69f0cfbb9c609ac922a6d45a7ef3d75b59d23c25.zip Qt-69f0cfbb9c609ac922a6d45a7ef3d75b59d23c25.tar.gz Qt-69f0cfbb9c609ac922a6d45a7ef3d75b59d23c25.tar.bz2 |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 11 |
1 files 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; |