Quick fix for quick 2-finger hover gesture 91/276591/2 accepted/tizen/6.0/unified/20220622.215311 submit/tizen_6.0/20220622.022043
authorArtur Świgoń <a.swigon@samsung.com>
Tue, 21 Jun 2022 11:37:08 +0000 (13:37 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Tue, 21 Jun 2022 11:40:11 +0000 (13:40 +0200)
This patch adds an extra emission of the 'ongoing' gesture signal before
'end' in case there wasn't one.

Change-Id: I877407bc4a120694411ce7d86f5445d19761066a

src/e_mod_main.c

index 8cb00f0ba6dde52f46d5d508d4efa3a00671c6a7..95d48bcc4200b88f12daf5b21af5e758fe942c4b 100644 (file)
@@ -213,6 +213,8 @@ const char *gesture_enum_to_string(Gesture g)
 
 int _e_mod_atspi_dbus_broadcast(Gesture_Info *gi)
 {
+   static int last_state = 0;
+
    /* Implement this for gesture broadcast */
    DEBUG("atspi bus broadcast callback");
    if (!conn) return -1;
@@ -235,12 +237,21 @@ int _e_mod_atspi_dbus_broadcast(Gesture_Info *gi)
     }
 //
 
+   // Ensure that there is at least one 'ongoing' signal before 'end' in two-finger hover
+   if (gi->state == 2 && last_state != 1 && gi->type == TWO_FINGERS_HOVER)
+    {
+       eldbus_service_signal_emit(g_context->iface, GESTURE_DETECTED_SIGNAL, (int)gi->type, gi->x_beg, gi->y_beg,
+                                  gi->x_end, gi->y_end, 1, gi->event_time - 5);
+    }
+
    eldbus_service_signal_emit(g_context->iface, GESTURE_DETECTED_SIGNAL, (int)gi->type, gi->x_beg, gi->y_beg,
                               gi->x_end, gi->y_end, gi->state, gi->event_time);
 
    INFO("GestureDetected %s %d (%d %d %d %d %d %u)", gesture_enum_to_string(gi->type),
         (int)gi->type, gi->x_beg, gi->y_beg, gi->x_end, gi->y_end, gi->state, gi->event_time);
 
+   last_state = gi->state;
+
    return 0;
 }