summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-01-17 13:28:05 -0500
committerChris Michael <cp.michael@samsung.com>2017-01-17 13:28:05 -0500
commit1974f5da2d10d83285e57dd314cc43829438c0fe (patch)
treeab149ecbc27300a2f71754172b71309a37d5a6eb
parent7906537c021c574fe4cebabbfff4134e8c9be730 (diff)
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 7906537c021c574fe4cebabbfff4134e8c9be730.
-rw-r--r--src/bin/e_comp_wl.c31
-rw-r--r--src/bin/e_comp_wl.h2
-rw-r--r--src/modules/xwayland/dnd.c6
3 files changed, 8 insertions, 31 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 58c940e9a..deaa6f404 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -369,15 +369,6 @@ _e_comp_wl_send_mouse_move(E_Client *ec, int x, int y, unsigned int timestamp)
369 wl_fixed_from_int(x - ec->client.x), 369 wl_fixed_from_int(x - ec->client.x),
370 wl_fixed_from_int(y - ec->client.y)); 370 wl_fixed_from_int(y - ec->client.y));
371 } 371 }
372
373 EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
374 {
375 if (!e_comp_wl_input_touch_check(res)) continue;
376 if (wl_resource_get_client(res) != wc) continue;
377 wl_touch_send_motion(res, timestamp, 1,
378 wl_fixed_from_int(x - ec->client.x),
379 wl_fixed_from_int(y - ec->client.y));
380 }
381} 372}
382 373
383static void 374static void
@@ -404,7 +395,6 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
404 Evas_Event_Mouse_Down *ev = event; 395 Evas_Event_Mouse_Down *ev = event;
405 396
406 e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button, 397 e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
407 ev->canvas.x, ev->canvas.y,
408 WL_POINTER_BUTTON_STATE_PRESSED); 398 WL_POINTER_BUTTON_STATE_PRESSED);
409} 399}
410 400
@@ -415,7 +405,6 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
415 Evas_Event_Mouse_Up *ev = event; 405 Evas_Event_Mouse_Up *ev = event;
416 406
417 e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button, 407 e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
418 ev->canvas.x, ev->canvas.y,
419 WL_POINTER_BUTTON_STATE_RELEASED); 408 WL_POINTER_BUTTON_STATE_RELEASED);
420} 409}
421 410
@@ -1354,6 +1343,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
1354 1343
1355 _e_comp_wl_surface_state_buffer_set(state, NULL); 1344 _e_comp_wl_surface_state_buffer_set(state, NULL);
1356 1345
1346
1357 if (ec->comp_data->shell.surface) 1347 if (ec->comp_data->shell.surface)
1358 { 1348 {
1359 if (ec->comp_data->shell.set.min_size.w) 1349 if (ec->comp_data->shell.set.min_size.w)
@@ -3327,7 +3317,7 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
3327} 3317}
3328 3318
3329E_API Eina_Bool 3319E_API Eina_Bool
3330e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, int x, int y, uint32_t state) 3320e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state)
3331{ 3321{
3332 Eina_List *l; 3322 Eina_List *l;
3333 struct wl_client *wc; 3323 struct wl_client *wc;
@@ -3378,6 +3368,9 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
3378 3368
3379 if (!ec->comp_data->surface) return EINA_FALSE; 3369 if (!ec->comp_data->surface) return EINA_FALSE;
3380 3370
3371 if (!eina_list_count(e_comp_wl->ptr.resources))
3372 return EINA_TRUE;
3373
3381 wc = wl_resource_get_client(ec->comp_data->surface); 3374 wc = wl_resource_get_client(ec->comp_data->surface);
3382 *state_serial = serial = wl_display_next_serial(e_comp_wl->wl.disp); 3375 *state_serial = serial = wl_display_next_serial(e_comp_wl->wl.disp);
3383 3376
@@ -3387,20 +3380,6 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
3387 if (!e_comp_wl_input_pointer_check(res)) continue; 3380 if (!e_comp_wl_input_pointer_check(res)) continue;
3388 wl_pointer_send_button(res, serial, timestamp, btn, state); 3381 wl_pointer_send_button(res, serial, timestamp, btn, state);
3389 } 3382 }
3390
3391 EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
3392 {
3393 if (wl_resource_get_client(res) != wc) continue;
3394 if (!e_comp_wl_input_touch_check(res)) continue;
3395 if (state == WL_POINTER_BUTTON_STATE_PRESSED)
3396 wl_touch_send_down(res, serial, timestamp,
3397 ec->comp_data->surface, 0,
3398 wl_fixed_from_int(x - ec->client.x),
3399 wl_fixed_from_int(y - ec->client.y));
3400 else
3401 wl_touch_send_up(res, serial, timestamp, 0);
3402 }
3403
3404 return EINA_TRUE; 3383 return EINA_TRUE;
3405} 3384}
3406 3385
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index ca8164859..a78f5cd0c 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -381,7 +381,7 @@ E_API void e_comp_wl_output_remove(const char *id);
381 381
382EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev); 382EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev);
383EINTERN Eina_Bool e_comp_wl_key_up(Ecore_Event_Key *ev); 383EINTERN Eina_Bool e_comp_wl_key_up(Ecore_Event_Key *ev);
384E_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); 384E_API Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state);
385 385
386E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD; 386E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;
387 387
diff --git a/src/modules/xwayland/dnd.c b/src/modules/xwayland/dnd.c
index 56b1fbaf7..47c5d9569 100644
--- a/src/modules/xwayland/dnd.c
+++ b/src/modules/xwayland/dnd.c
@@ -93,11 +93,9 @@ _xwayland_drop(E_Drag *drag, int dropped)
93 if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return; 93 if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return;
94 e_comp_wl->drag = NULL; 94 e_comp_wl->drag = NULL;
95 if ((!e_comp_wl->ptr.ec) || 95 if ((!e_comp_wl->ptr.ec) ||
96 (wl_resource_get_client(e_comp_wl->ptr.ec->comp_data->surface) != e_comp_wl->xwl_client)) 96 (wl_resource_get_client(e_comp_wl->ptr.ec->comp_data->surface) != e_comp_wl->xwl_client))
97 e_comp_wl_evas_handle_mouse_button(e_comp_wl->drag_client, 0, 97 e_comp_wl_evas_handle_mouse_button(e_comp_wl->drag_client, 0,
98 e_comp_wl->ptr.button, 98 e_comp_wl->ptr.button, WL_POINTER_BUTTON_STATE_RELEASED);
99 e_comp_wl->ptr.x, e_comp_wl->ptr.y,
100 WL_POINTER_BUTTON_STATE_RELEASED);
101 if (dropped || e_object_is_del(E_OBJECT(drag)) || (!e_comp_wl->selection.target)) 99 if (dropped || e_object_is_del(E_OBJECT(drag)) || (!e_comp_wl->selection.target))
102 _xdnd_finish(0); 100 _xdnd_finish(0);
103 else 101 else