{
Ecore_Event_Mouse_Button *ev = event;
- gesture->gesture_events.num_pressed--;
+ if (gesture->gesture_events.num_pressed == 0)
+ {
+ return EINA_TRUE;
+ }
+ gesture->gesture_events.num_pressed--;
if (!gesture->grabbed_gesture)
{
return EINA_TRUE;
if (gesture->gesture_events.num_pressed == 0)
{
gesture->gesture_events.recognized_gesture = 0x0;
+ if (gesture->enable)
+ {
+ e_gesture_event_filter_enable(EINA_TRUE);
+ }
+ else
+ {
+ e_gesture_event_filter_enable(EINA_FALSE);
+ }
}
return EINA_FALSE;
}
{
Ecore_Event_Mouse_Move *ev = event;
+ if (gesture->gesture_events.num_pressed == 0)
+ {
+ return EINA_TRUE;
+ }
if (!gesture->grabbed_gesture)
{
return EINA_TRUE;
wl_resource_set_implementation(resource, &_e_gesture_implementation, gesture_instance, _e_gesture_cb_destory);
}
-
-
static Eina_Bool
_e_gesture_event_filter(void *data, void *loop_data EINA_UNUSED, int type, void *event)
{
(void) data;
+ if (!gesture->enable) return EINA_TRUE;
return e_gesture_process_events(event, type);
}
if (ec->gesture_disable && gesture->enable)
{
- GTINF("Disable gesture\n");
- ecore_event_filter_del(gesture->ef_handler);
- gesture->ef_handler = NULL;
+ GTINF("Gesture disabled window\n");
gesture->enable = EINA_FALSE;
}
else if (!ec->gesture_disable && !gesture->enable)
{
- GTINF("enable gesture\n");
- gesture->ef_handler = ecore_event_filter_add(NULL, _e_gesture_event_filter, NULL, NULL);
+ GTINF("Gesture enabled window\n");
gesture->enable = EINA_TRUE;
}
+ if (gesture->gesture_events.num_pressed == 0)
+ {
+ e_gesture_event_filter_enable(gesture->enable);
+ }
+
return ECORE_CALLBACK_PASS_ON;
}
}
}
}
+
+void
+e_gesture_event_filter_enable(Eina_Bool enabled)
+{
+ if (enabled && !gesture->enable)
+ {
+ GTINF("Gestures will be enabled by for now.\n");
+ gesture->enable = EINA_TRUE;
+ }
+ else if (!enabled && gesture->enable)
+ {
+ GTINF("Gestures will be enabled from now.\n");
+ gesture->enable = EINA_FALSE;
+ }
+}
\ No newline at end of file