From 781d3e3157dbca9619ac1e99f53e3a2a92656ff7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Artur=20=C5=9Awigo=C5=84?= Date: Tue, 21 Jun 2022 13:37:08 +0200 Subject: [PATCH] Quick fix for quick 2-finger hover gesture 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/e_mod_main.c b/src/e_mod_main.c index f19ed80..52b8362 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -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; } -- 2.7.4