=== modified file 'libunity-2d-private/src/gesturehandler.cpp' --- libunity-2d-private/src/gesturehandler.cpp 2012-02-10 16:28:48 +0000 +++ libunity-2d-private/src/gesturehandler.cpp 2012-04-11 09:19:13 +0000 @@ -29,6 +29,7 @@ : QObject(parent) , m_geisInstance(NULL) , m_isDragging(false) +, m_dashManager(NULL) { if (geisInitialize() != GEIS_STATUS_SUCCESS) { UQ_WARNING << "GEIS initialization failed: multitouch support disabled"; @@ -117,23 +118,6 @@ &m_gestureFuncs, this); } - -static void toggleDash() -{ - /* A 4 fingers tap will either: - - show the home page of the dash if the dash is closed - - close the dash, if the dash is opened - */ - QDBusInterface dashInterface("com.canonical.Unity2d.Dash", "/Dash", "com.canonical.Unity2d.Dash"); - bool dashActive = dashInterface.property("active").toBool(); - - if (dashActive) { - dashInterface.setProperty("active", false); - } else { - dashInterface.call(QDBus::Block, "activateHome"); - } -} - /* FIXME: zooming in/out in the spread should have 3 levels: 1) showing all windows of the focused application in the current workspace 2) showing all windows in the current workspace @@ -232,7 +216,10 @@ if (gestureName == GEIS_GESTURE_TYPE_TAP4) { /* 4 fingers tap toggles the dash on and off */ - toggleDash(); + Q_ASSERT(m_dashManager != NULL); + if (m_dashManager != NULL) { + QMetaObject::invokeMethod(m_dashManager, "toggleDashRequested"); + } } else if (gestureName == GEIS_GESTURE_TYPE_PINCH3) { /* Continuing a 3 fingers pinch inwards/outwards shows/hides the workspace switcher. */ int timestamp = attributes[GEIS_GESTURE_ATTRIBUTE_TIMESTAMP].integer_val; @@ -291,4 +278,14 @@ return m_isDragging; } +QObject *GestureHandler::dashManager() const +{ + return m_dashManager; +} + +void GestureHandler::setDashManager(QObject *dashManager) +{ + m_dashManager = dashManager; +} + #include "gesturehandler.moc" === modified file 'libunity-2d-private/src/gesturehandler.h' --- libunity-2d-private/src/gesturehandler.h 2011-11-14 18:40:49 +0000 +++ libunity-2d-private/src/gesturehandler.h 2012-04-11 09:19:15 +0000 @@ -33,6 +33,7 @@ Q_OBJECT Q_PROPERTY(double dragDelta READ dragDelta NOTIFY dragDeltaChanged) Q_PROPERTY(bool isDragging READ isDragging NOTIFY isDraggingChanged) + Q_PROPERTY(QObject *dashManager READ dashManager WRITE setDashManager) public: explicit GestureHandler(QObject *parent = 0); @@ -41,6 +42,9 @@ double dragDelta() const; bool isDragging() const; + QObject *dashManager() const; + void setDashManager(QObject *dashManager); + Q_SIGNALS: void dragDeltaChanged(); void isDraggingChanged(); @@ -70,6 +74,7 @@ int m_pinchPreviousTimestamp; float m_dragDelta; bool m_isDragging; + QObject *m_dashManager; }; Q_DECLARE_METATYPE(GestureHandler*) === modified file 'shell/Shell.qml' --- shell/Shell.qml 2012-04-06 15:16:39 +0000 +++ shell/Shell.qml 2012-04-11 09:14:05 +0000 @@ -58,6 +58,7 @@ GestureHandler { id: gestureHandler + dashManager: shellManager } onDashLoaderChanged: {