Bug 682458 - Disable default gesture filters in Qt widget. r=dougt
authorOleg Romashin <romaxa@gmail.com>
Sun, 28 Aug 2011 19:09:56 +0100
changeset 76014 a12d726a586808a6de30983a9d38e4a69f0de795
parent 76013 7c905a200bcc1f914e867a104f9256dcf8c4e37a
child 76015 ca5a3569462d7b03ba1da27ed161e1d506190912
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersdougt
bugs682458
milestone9.0a1
Bug 682458 - Disable default gesture filters in Qt widget. r=dougt
widget/src/qt/nsWindow.cpp
--- a/widget/src/qt/nsWindow.cpp
+++ b/widget/src/qt/nsWindow.cpp
@@ -2690,16 +2690,25 @@ nsWindow::createQWidget(MozQWidget *pare
             // Disable double buffer and system background rendering
 #ifdef MOZ_X11
             newView->viewport()->setAttribute(Qt::WA_PaintOnScreen, true);
 #endif
             newView->viewport()->setAttribute(Qt::WA_NoSystemBackground, true);
         }
         // Enable gestures:
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
+#if defined MOZ_ENABLE_MEEGOTOUCH
+        // Disable default Gesture filters (speedup filtering)
+        newView->viewport()->ungrabGesture(Qt::PanGesture);
+        newView->viewport()->ungrabGesture(Qt::TapGesture);
+        newView->viewport()->ungrabGesture(Qt::TapAndHoldGesture);
+        newView->viewport()->ungrabGesture(Qt::SwipeGesture);
+#endif
+
+        // Enable required filters
         newView->viewport()->grabGesture(Qt::PinchGesture);
         newView->viewport()->grabGesture(gSwipeGestureId);
 #endif
         newView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
         newView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
         // Top level widget is just container, and should not be painted
@@ -2720,16 +2729,23 @@ nsWindow::createQWidget(MozQWidget *pare
         // XXX is this needed for Qt?
         // gdk does not automatically set the cursor for "temporary"
         // windows, which are what gtk uses for popups.
         SetCursor(eCursor_standard);
     } else if (mIsTopLevel) {
         SetDefaultIcon();
     }
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
+#if defined MOZ_ENABLE_MEEGOTOUCH
+    // Disable default Gesture filters (speedup filtering)
+    widget->ungrabGesture(Qt::PanGesture);
+    widget->ungrabGesture(Qt::TapGesture);
+    widget->ungrabGesture(Qt::TapAndHoldGesture);
+    widget->ungrabGesture(Qt::SwipeGesture);
+#endif
     widget->grabGesture(Qt::PinchGesture);
     widget->grabGesture(gSwipeGestureId);
 #endif
 
     return widget;
 }
 
 // return the gfxASurface for rendering to this widget