Quick fix for quick 2-finger hover gesture 67/277267/1 accepted/tizen/unified/20220711.173817 submit/tizen/20220711.052601
authorArtur Świgoń <a.swigon@samsung.com>
Tue, 21 Jun 2022 11:37:08 +0000 (13:37 +0200)
committerjykeon <jykeon@samsung.com>
Mon, 4 Jul 2022 07:55:36 +0000 (16:55 +0900)
This patch adds an extra emission of the 'ongoing' gesture signal before
'end' in case there wasn't one.

Change-Id: I877407bc4a120694411ce7d86f5445d19761066a
(cherry picked from commit 9792b9f611bc971fc856c1bac7e9a29430ab231f)

src/e_mod_main.c

index f19ed80..52b8362 100644 (file)
@@ -214,6 +214,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;
@@ -236,15 +238,26 @@ int _e_mod_atspi_dbus_broadcast(Gesture_Info *gi)
     }
 //
 
+
    E_Client *client = e_client_under_position_get(desk, gi->x_beg, gi->y_beg, NULL);
    uint32_t resID = e_pixmap_res_id_get(client->pixmap);
 
+   // 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, resID);
 
    INFO("GestureDetected %s %d (%d %d %d %d %d %u) resID: %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, resID);
 
+   last_state = gi->state;
+
    return 0;
 }