summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-22 18:35:10 +0900
committerHermet Park <hermetpark@gmail.com>2018-08-22 18:35:11 +0900
commitba3fe6c1cb8998034ce9585940a652747173bb39 (patch)
tree56e16cc86510c3e5832ab92966273b6352cf4041 /src/lib/ecore_evas
parente3b6f5a959b020d68abd4c0363afff7183e6cb8a (diff)
ecore-evas/buffer: implement ignore_events method
Summary: this is a simple implementation of ignore_events functionality which sets pass_events if it's an image or prevents the emission of events in other cases the result should be that no user events are received. this deliberately does not block the triggering of resize callbacks as in the original ticket since this guarantees broken functionality and is just not a good idea fix T4700 Reviewers: devilhorns, Hermet Reviewed By: Hermet Subscribers: Hermet, cedric, #reviewers, #committers Tags: #efl_display_system Maniphest Tasks: T4700 Differential Revision: https://phab.enlightenment.org/D6876
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index cad4999337..59cd5aeb63 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -111,6 +111,17 @@ _ecore_evas_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNUSED, in
111} 111}
112 112
113static void 113static void
114_ecore_evas_buffer_ignore_events_set(Ecore_Evas *ee, int val)
115{
116 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
117
118 if (ee->ignore_events == val) return;
119 ee->ignore_events = val;
120 if (bdata->image)
121 evas_object_pass_events_set(bdata->image, val);
122}
123
124static void
114_ecore_evas_show(Ecore_Evas *ee) 125_ecore_evas_show(Ecore_Evas *ee)
115{ 126{
116 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; 127 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
@@ -272,6 +283,7 @@ _ecore_evas_buffer_cb_mouse_in(void *data, Evas *e, Evas_Object *obj EINA_UNUSED
272 ee = data; 283 ee = data;
273 ev = event_info; 284 ev = event_info;
274 if (!ee->evas) return; 285 if (!ee->evas) return;
286 if (ee->ignore_events) return;
275 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 287 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
276 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL); 288 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
277} 289}
@@ -285,6 +297,7 @@ _ecore_evas_buffer_cb_mouse_out(void *data, Evas *e, Evas_Object *obj EINA_UNUSE
285 ee = data; 297 ee = data;
286 ev = event_info; 298 ev = event_info;
287 if (!ee->evas) return; 299 if (!ee->evas) return;
300 if (ee->ignore_events) return;
288 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 301 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
289 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL); 302 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
290} 303}
@@ -298,6 +311,7 @@ _ecore_evas_buffer_cb_mouse_down(void *data, Evas *e, Evas_Object *obj EINA_UNUS
298 ee = data; 311 ee = data;
299 ev = event_info; 312 ev = event_info;
300 if (!ee->evas) return; 313 if (!ee->evas) return;
314 if (ee->ignore_events) return;
301 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 315 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
302 evas_event_feed_mouse_down(ee->evas, ev->button, ev->flags, ev->timestamp, NULL); 316 evas_event_feed_mouse_down(ee->evas, ev->button, ev->flags, ev->timestamp, NULL);
303} 317}
@@ -311,6 +325,7 @@ _ecore_evas_buffer_cb_mouse_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED
311 ee = data; 325 ee = data;
312 ev = event_info; 326 ev = event_info;
313 if (!ee->evas) return; 327 if (!ee->evas) return;
328 if (ee->ignore_events) return;
314 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 329 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
315 evas_event_feed_mouse_up(ee->evas, ev->button, ev->flags, ev->timestamp, NULL); 330 evas_event_feed_mouse_up(ee->evas, ev->button, ev->flags, ev->timestamp, NULL);
316} 331}
@@ -341,6 +356,7 @@ _ecore_evas_buffer_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj EINA_UNU
341 ee = data; 356 ee = data;
342 ev = event_info; 357 ev = event_info;
343 if (!ee->evas) return; 358 if (!ee->evas) return;
359 if (ee->ignore_events) return;
344 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 360 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
345 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, ev->timestamp, NULL); 361 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, ev->timestamp, NULL);
346} 362}
@@ -360,6 +376,7 @@ _ecore_evas_buffer_cb_multi_down(void *data, Evas *e, Evas_Object *obj EINA_UNUS
360 xx = x; 376 xx = x;
361 yy = y; 377 yy = y;
362 if (!ee->evas) return; 378 if (!ee->evas) return;
379 if (ee->ignore_events) return;
363 _ecore_evas_buffer_coord_translate(ee, &x, &y); 380 _ecore_evas_buffer_coord_translate(ee, &x, &y);
364 xf = (ev->canvas.xsub - (double)xx) + (double)x; 381 xf = (ev->canvas.xsub - (double)xx) + (double)x;
365 yf = (ev->canvas.ysub - (double)yy) + (double)y; 382 yf = (ev->canvas.ysub - (double)yy) + (double)y;
@@ -382,6 +399,7 @@ _ecore_evas_buffer_cb_multi_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED
382 xx = x; 399 xx = x;
383 yy = y; 400 yy = y;
384 if (!ee->evas) return; 401 if (!ee->evas) return;
402 if (ee->ignore_events) return;
385 _ecore_evas_buffer_coord_translate(ee, &x, &y); 403 _ecore_evas_buffer_coord_translate(ee, &x, &y);
386 xf = (ev->canvas.xsub - (double)xx) + (double)x; 404 xf = (ev->canvas.xsub - (double)xx) + (double)x;
387 yf = (ev->canvas.ysub - (double)yy) + (double)y; 405 yf = (ev->canvas.ysub - (double)yy) + (double)y;
@@ -404,6 +422,7 @@ _ecore_evas_buffer_cb_multi_move(void *data, Evas *e, Evas_Object *obj EINA_UNUS
404 xx = x; 422 xx = x;
405 yy = y; 423 yy = y;
406 if (!ee->evas) return; 424 if (!ee->evas) return;
425 if (ee->ignore_events) return;
407 _ecore_evas_buffer_coord_translate(ee, &x, &y); 426 _ecore_evas_buffer_coord_translate(ee, &x, &y);
408 xf = (ev->cur.canvas.xsub - (double)xx) + (double)x; 427 xf = (ev->cur.canvas.xsub - (double)xx) + (double)x;
409 yf = (ev->cur.canvas.ysub - (double)yy) + (double)y; 428 yf = (ev->cur.canvas.ysub - (double)yy) + (double)y;
@@ -429,6 +448,7 @@ _ecore_evas_buffer_cb_key_down(void *data, Evas *e, Evas_Object *obj EINA_UNUSED
429 ee = data; 448 ee = data;
430 ev = event_info; 449 ev = event_info;
431 if (!ee->evas) return; 450 if (!ee->evas) return;
451 if (ee->ignore_events) return;
432 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 452 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
433 evas_event_feed_key_down(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL); 453 evas_event_feed_key_down(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL);
434} 454}
@@ -442,6 +462,7 @@ _ecore_evas_buffer_cb_key_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED,
442 ee = data; 462 ee = data;
443 ev = event_info; 463 ev = event_info;
444 if (!ee->evas) return; 464 if (!ee->evas) return;
465 if (ee->ignore_events) return;
445 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas); 466 _ecore_evas_buffer_transfer_modifiers_locks(e, ee->evas);
446 evas_event_feed_key_up(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL); 467 evas_event_feed_key_up(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL);
447} 468}
@@ -589,7 +610,7 @@ _ecore_evas_buffer_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y
589 610
590 if (bdata->image) 611 if (bdata->image)
591 _ecore_evas_mouse_move_process((Ecore_Evas*)ee, x, y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff)); 612 _ecore_evas_mouse_move_process((Ecore_Evas*)ee, x, y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
592 else 613 else if (!ee->ignore_events)
593 { 614 {
594 Ecore_Event_Mouse_Move *ev; 615 Ecore_Event_Mouse_Move *ev;
595 616
@@ -683,7 +704,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
683 NULL, 704 NULL,
684 NULL, 705 NULL,
685 NULL, 706 NULL,
686 NULL, 707 _ecore_evas_buffer_ignore_events_set,
687 _ecore_evas_buffer_alpha_set, 708 _ecore_evas_buffer_alpha_set,
688 NULL, //transparent 709 NULL, //transparent
689 NULL, // profiles_set 710 NULL, // profiles_set