Fix gesture handling after signature change.
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Fri, 7 Nov 2014 16:31:08 +0000 (17:31 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Fri, 7 Nov 2014 16:31:08 +0000 (17:31 +0100)
This commit fixes issues with message parsing after a change
in com.samsung.EATSPI DBus intefface.

include/gesture_tracker.h
src/gesture_tracker.c

index 000e887..b1355bb 100644 (file)
@@ -25,6 +25,7 @@ typedef struct {
      Gesture type;         // Type of recognized gesture
      int x_begin, x_end;     // (x,y) coordinates when gesture begin
      int y_begin, y_end;     // (x,y) coordinates when gesture ends
+     int state;              // 0 - gesture begins, 1 - continues, 2 - ended
 } Gesture_Info;
 
 
index 34b3f65..867136e 100644 (file)
@@ -18,7 +18,7 @@ static Gesture gesture_name_to_enum (const char *gesture_name)
   if(!gesture_name)
      return GESTURES_COUNT;
  
-  ERROR("Dbus incoming gesture: %s", gesture_name);
+  DEBUG("Dbus incoming gesture: %s", gesture_name);
  
   if(!strcmp("OneFingerHover", gesture_name))
      return ONE_FINGER_HOVER;
@@ -62,9 +62,9 @@ static Gesture gesture_name_to_enum (const char *gesture_name)
 static void on_gesture_detected(void *context EINA_UNUSED, const Eldbus_Message *msg)
 {
     const char *gesture_name;
-    int x_s, y_s, x_e, y_e;
+    int x_s, y_s, x_e, y_e, state;
 
-    if(!eldbus_message_arguments_get(msg, "siiii", &gesture_name, &x_s, &y_s, &x_e, &y_e))
+    if(!eldbus_message_arguments_get(msg, "siiiiu", &gesture_name, &x_s, &y_s, &x_e, &y_e, &state))
         ERROR("error geting arguments on_gesture_detected");
 
     Gesture_Info g;
@@ -73,6 +73,7 @@ static void on_gesture_detected(void *context EINA_UNUSED, const Eldbus_Message
     g.y_begin = y_s;
     g.x_end = x_e;
     g.y_end = y_e;
+    g.state = state;
 
     if(user_cb)
         user_cb(user_data, &g);