When a user touch the screen (down & up), the master activate the thread and deactivate it shortly.
while processing this, the input thread's state machine goes wrong.
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]
Change-Id: Ib911c542456d37a5d5078f40d2c1c36ecf83bb2c
extern int event_deactivate_thread(enum event_handler_activate_type activate_type);
extern int event_activate_thread(enum event_handler_activate_type activate_type);
+extern void event_set_mouse_xy(int x, int y, double timestamp);
+
/* End of a file */
Eina_List *l;
Eina_List *n;
enum event_state next_state;
+ int state;
fd = ecore_main_fd_handler_fd_get(handler);
if (fd < 0) {
case EVENT_STATE_DEACTIVATE:
if (compare_timestamp(listener, item) < 0) {
/* Consuming all events occurred while activating this listener */
+ state = listener->prev_state;
listener->prev_state = listener->state;
- listener->state = EVENT_STATE_ACTIVATED;
+
+ if (state == EVENT_STATE_ACTIVATE) {
+ /**
+ * @note
+ * If the previous state is ACTIVATE
+ * We should create DOWN event first.
+ */
+ listener->state = EVENT_STATE_ACTIVATE;
+ } else {
+ listener->state = EVENT_STATE_ACTIVATED;
+ }
+
if (invoke_event_cb(listener, item) == 1) {
/* listener is deleted */
continue;
}
- listener->prev_state = listener->state;
+ if (listener->state == EVENT_STATE_ACTIVATE) {
+ /**
+ * We are already jumped into the DEACTIVATE state
+ * But the state is ACTIVATE, it means, we forcely chnaged it from LINE 747
+ * We successfully sent the DOWN event.
+ * We only need to send UP (or move) event.
+ * So change the previous states to ACTIVATED and then change current states to
+ * DEACTIVATE again.
+ */
+ listener->prev_state = EVENT_STATE_ACTIVATED;
+ } else {
+ listener->prev_state = listener->state;
+ }
+
listener->state = EVENT_STATE_DEACTIVATE;
} else {
memcpy(&s_info.skipped_event_data, item, sizeof(s_info.skipped_event_data));
return s_info.handle >= 0;
}
+HAPI void event_set_mouse_xy(int x, int y, double timestamp)
+{
+ s_info.event_data.x = x;
+ s_info.event_data.y = y;
+ s_info.event_data.tv = timestamp;
+ /**
+ * Don't touch the timestamp_updated variable.
+ * if we toggle it, the input thread will not be terminated correctly. SEE LINE: 537
+ if (!s_info.timestamp_updated) {
+ // NOP
+ }
+ */
+}
+
/* End of a file */
if (package_widget_type(pkg) == WIDGET_TYPE_BUFFER) {
if (package_direct_input(pkg) == 0) {
+ /* Forcely update the X,Y position using viewer's */
+ event_set_mouse_xy(x, y, timestamp);
+
ret = event_deactivate(mouse_event_widget_route_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_OFF);
}
}
} else if (package_widget_type(pkg) == WIDGET_TYPE_SCRIPT) {
+ /* Forcely update the X,Y position using viewer's */
+ event_set_mouse_xy(x, y, timestamp);
+
ret = event_deactivate(mouse_event_widget_consume_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_OFF);
if (package_gbar_type(pkg) == GBAR_TYPE_BUFFER) {
if (package_direct_input(pkg) == 0) {
+ /* Forcely update the X,Y position using viewer's */
+ event_set_mouse_xy(x, y, timestamp);
+
ret = event_deactivate(mouse_event_gbar_route_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_OFF);
}
}
} else if (package_gbar_type(pkg) == GBAR_TYPE_SCRIPT) {
+ /* Forcely update the X,Y position using viewer's */
+ event_set_mouse_xy(x, y, timestamp);
+
ret = event_deactivate(mouse_event_gbar_consume_cb, inst);
if (WIDGET_CONF_SLAVE_EVENT_BOOST_OFF != WIDGET_CONF_SLAVE_EVENT_BOOST_ON) {
(void)slave_set_priority(package_slave(pkg), WIDGET_CONF_SLAVE_EVENT_BOOST_OFF);