Revert "send wl_touch events when we handle mouse buttons"

Reverting this as it ends up causing multiple events being handled
(touch and pointer) inside various clients if you have both touch and
pointer enabled. Will need a different fix here....

This reverts commit 7906537c02.
This commit is contained in:
Chris Michael 2017-01-17 13:28:05 -05:00
parent 7906537c02
commit 1974f5da2d
3 changed files with 8 additions and 31 deletions

View File

@ -369,15 +369,6 @@ _e_comp_wl_send_mouse_move(E_Client *ec, int x, int y, unsigned int timestamp)
wl_fixed_from_int(x - ec->client.x), wl_fixed_from_int(x - ec->client.x),
wl_fixed_from_int(y - ec->client.y)); wl_fixed_from_int(y - ec->client.y));
} }
EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
{
if (!e_comp_wl_input_touch_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
wl_touch_send_motion(res, timestamp, 1,
wl_fixed_from_int(x - ec->client.x),
wl_fixed_from_int(y - ec->client.y));
}
} }
static void static void
@ -404,7 +395,6 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
Evas_Event_Mouse_Down *ev = event; Evas_Event_Mouse_Down *ev = event;
e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button, e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
ev->canvas.x, ev->canvas.y,
WL_POINTER_BUTTON_STATE_PRESSED); WL_POINTER_BUTTON_STATE_PRESSED);
} }
@ -415,7 +405,6 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
Evas_Event_Mouse_Up *ev = event; Evas_Event_Mouse_Up *ev = event;
e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button, e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
ev->canvas.x, ev->canvas.y,
WL_POINTER_BUTTON_STATE_RELEASED); WL_POINTER_BUTTON_STATE_RELEASED);
} }
@ -1354,6 +1343,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
_e_comp_wl_surface_state_buffer_set(state, NULL); _e_comp_wl_surface_state_buffer_set(state, NULL);
if (ec->comp_data->shell.surface) if (ec->comp_data->shell.surface)
{ {
if (ec->comp_data->shell.set.min_size.w) if (ec->comp_data->shell.set.min_size.w)
@ -3327,7 +3317,7 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
} }
E_API Eina_Bool E_API Eina_Bool
e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, int x, int y, uint32_t state) e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state)
{ {
Eina_List *l; Eina_List *l;
struct wl_client *wc; struct wl_client *wc;
@ -3378,6 +3368,9 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
if (!ec->comp_data->surface) return EINA_FALSE; if (!ec->comp_data->surface) return EINA_FALSE;
if (!eina_list_count(e_comp_wl->ptr.resources))
return EINA_TRUE;
wc = wl_resource_get_client(ec->comp_data->surface); wc = wl_resource_get_client(ec->comp_data->surface);
*state_serial = serial = wl_display_next_serial(e_comp_wl->wl.disp); *state_serial = serial = wl_display_next_serial(e_comp_wl->wl.disp);
@ -3387,20 +3380,6 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
if (!e_comp_wl_input_pointer_check(res)) continue; if (!e_comp_wl_input_pointer_check(res)) continue;
wl_pointer_send_button(res, serial, timestamp, btn, state); wl_pointer_send_button(res, serial, timestamp, btn, state);
} }
EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
if (!e_comp_wl_input_touch_check(res)) continue;
if (state == WL_POINTER_BUTTON_STATE_PRESSED)
wl_touch_send_down(res, serial, timestamp,
ec->comp_data->surface, 0,
wl_fixed_from_int(x - ec->client.x),
wl_fixed_from_int(y - ec->client.y));
else
wl_touch_send_up(res, serial, timestamp, 0);
}
return EINA_TRUE; return EINA_TRUE;
} }

View File

@ -381,7 +381,7 @@ E_API void e_comp_wl_output_remove(const char *id);
EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev); EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev);
EINTERN Eina_Bool e_comp_wl_key_up(Ecore_Event_Key *ev); EINTERN Eina_Bool e_comp_wl_key_up(Ecore_Event_Key *ev);
E_API Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, int x, int y, uint32_t state); E_API Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state);
E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD; E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;

View File

@ -93,11 +93,9 @@ _xwayland_drop(E_Drag *drag, int dropped)
if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return; if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return;
e_comp_wl->drag = NULL; e_comp_wl->drag = NULL;
if ((!e_comp_wl->ptr.ec) || if ((!e_comp_wl->ptr.ec) ||
(wl_resource_get_client(e_comp_wl->ptr.ec->comp_data->surface) != e_comp_wl->xwl_client)) (wl_resource_get_client(e_comp_wl->ptr.ec->comp_data->surface) != e_comp_wl->xwl_client))
e_comp_wl_evas_handle_mouse_button(e_comp_wl->drag_client, 0, e_comp_wl_evas_handle_mouse_button(e_comp_wl->drag_client, 0,
e_comp_wl->ptr.button, e_comp_wl->ptr.button, WL_POINTER_BUTTON_STATE_RELEASED);
e_comp_wl->ptr.x, e_comp_wl->ptr.y,
WL_POINTER_BUTTON_STATE_RELEASED);
if (dropped || e_object_is_del(E_OBJECT(drag)) || (!e_comp_wl->selection.target)) if (dropped || e_object_is_del(E_OBJECT(drag)) || (!e_comp_wl->selection.target))
_xdnd_finish(0); _xdnd_finish(0);
else else