summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-03 12:07:40 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-11-28 13:57:55 -0200
commitbe609118c6a23a80e5a3271a6294621baa3e480a (patch)
tree20ef9378b6cbf69d1f4fea2b4ca5e67cdb209a01 /src/modules
parent6b95c4c2eccff5976992b9a4d557e586d90511d1 (diff)
Ecore_Evas: Add support for per-seat focus.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c13
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c3
-rw-r--r--src/modules/ecore_evas/engines/extn/ecore_evas_extn.c27
-rw-r--r--src/modules/ecore_evas/engines/fb/ecore_evas_fb.c17
-rw-r--r--src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c21
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c20
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c13
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c15
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c17
9 files changed, 62 insertions, 84 deletions
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 1bfb0850e9..9271d5bc9e 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -186,10 +186,7 @@ _ecore_evas_cocoa_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED,
186 ee = _ecore_evas_cocoa_match(e->cocoa_window); 186 ee = _ecore_evas_cocoa_match(e->cocoa_window);
187 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 187 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
188 188
189 ee->prop.focused = EINA_TRUE; 189 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
190 evas_focus_in(ee->evas);
191 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
192
193 return ECORE_CALLBACK_PASS_ON; 190 return ECORE_CALLBACK_PASS_ON;
194} 191}
195 192
@@ -202,10 +199,7 @@ _ecore_evas_cocoa_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED,
202 ee = _ecore_evas_cocoa_match(e->cocoa_window); 199 ee = _ecore_evas_cocoa_match(e->cocoa_window);
203 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 200 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
204 201
205 evas_focus_out(ee->evas); 202 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
206 ee->prop.focused = EINA_FALSE;
207 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
208
209 return ECORE_CALLBACK_PASS_ON; 203 return ECORE_CALLBACK_PASS_ON;
210} 204}
211 205
@@ -676,6 +670,9 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
676 NULL, // fn_animator_unregister 670 NULL, // fn_animator_unregister
677 671
678 NULL, // fn_evas_changed 672 NULL, // fn_evas_changed
673 NULL, //fn_focus_device_set
674 NULL, //fn_callback_focus_device_in_set
675 NULL, //fn_callback_focus_device_out_set
679 }; 676 };
680 677
681static Ecore_Cocoa_Window * 678static Ecore_Cocoa_Window *
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index d0f730a0f5..917f1defb7 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -793,6 +793,9 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
793 _drm_animator_unregister, // animator_unregister 793 _drm_animator_unregister, // animator_unregister
794 794
795 _drm_evas_changed, // evas_changed 795 _drm_evas_changed, // evas_changed
796 NULL, //fn_focus_device_set
797 NULL, //fn_callback_focus_device_in_set
798 NULL, //fn_callback_focus_device_out_set
796}; 799};
797 800
798static Ecore_Evas * 801static Ecore_Evas *
diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index 785f9cd0f4..ff392bfa0b 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -750,8 +750,11 @@ _ecore_evas_extn_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E
750 Ecore_Evas *ee = data; 750 Ecore_Evas *ee = data;
751 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; 751 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
752 Extn *extn; 752 Extn *extn;
753 Evas_Device *dev;
753 754
754 ee->prop.focused = EINA_TRUE; 755 dev = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
756 if (ecore_evas_focus_device_get(ee, dev)) return;
757 ee->prop.focused_by = eina_list_append(ee->prop.focused_by, dev);
755 extn = bdata->data; 758 extn = bdata->data;
756 if (!extn) return; 759 if (!extn) return;
757 if (!extn->ipc.server) return; 760 if (!extn->ipc.server) return;
@@ -765,7 +768,8 @@ _ecore_evas_extn_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
765 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; 768 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
766 Extn *extn; 769 Extn *extn;
767 770
768 ee->prop.focused = EINA_FALSE; 771 ee->prop.focused_by = eina_list_remove(ee->prop.focused_by,
772 evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT));
769 extn = bdata->data; 773 extn = bdata->data;
770 if (!extn) return; 774 if (!extn) return;
771 if (!extn->ipc.server) return; 775 if (!extn->ipc.server) return;
@@ -916,6 +920,9 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
916 NULL, // fn_animator_unregister 920 NULL, // fn_animator_unregister
917 921
918 NULL, // fn_evas_changed 922 NULL, // fn_evas_changed
923 NULL, //fn_focus_device_set
924 NULL, //fn_callback_focus_device_in_set
925 NULL, //fn_callback_focus_device_out_set
919}; 926};
920 927
921static Eina_Bool 928static Eina_Bool
@@ -1199,7 +1206,6 @@ ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target)
1199 ee->prop.max.w = 0; 1206 ee->prop.max.w = 0;
1200 ee->prop.max.h = 0; 1207 ee->prop.max.h = 0;
1201 ee->prop.layer = 0; 1208 ee->prop.layer = 0;
1202 ee->prop.focused = EINA_FALSE;
1203 ee->prop.borderless = EINA_TRUE; 1209 ee->prop.borderless = EINA_TRUE;
1204 ee->prop.override = EINA_TRUE; 1210 ee->prop.override = EINA_TRUE;
1205 ee->prop.maximized = EINA_FALSE; 1211 ee->prop.maximized = EINA_FALSE;
@@ -1660,20 +1666,10 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event)
1660 } 1666 }
1661 break; 1667 break;
1662 case OP_FOCUS: 1668 case OP_FOCUS:
1663 if (!ee->prop.focused) 1669 if (!ecore_evas_focus_device_get(ee, NULL)) _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
1664 {
1665 ee->prop.focused = EINA_TRUE;
1666 evas_focus_in(ee->evas);
1667 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
1668 }
1669 break; 1670 break;
1670 case OP_UNFOCUS: 1671 case OP_UNFOCUS:
1671 if (ee->prop.focused) 1672 if (ecore_evas_focus_device_get(ee, NULL)) _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
1672 {
1673 ee->prop.focused = EINA_FALSE;
1674 evas_focus_out(ee->evas);
1675 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
1676 }
1677 break; 1673 break;
1678 case OP_EV_MOUSE_IN: 1674 case OP_EV_MOUSE_IN:
1679 if (ee->events_block) break; 1675 if (ee->events_block) break;
@@ -2125,7 +2121,6 @@ ecore_evas_extn_socket_new_internal(int w, int h)
2125 ee->prop.max.w = 0; 2121 ee->prop.max.w = 0;
2126 ee->prop.max.h = 0; 2122 ee->prop.max.h = 0;
2127 ee->prop.layer = 0; 2123 ee->prop.layer = 0;
2128 ee->prop.focused = EINA_FALSE;
2129 ee->prop.borderless = EINA_TRUE; 2124 ee->prop.borderless = EINA_TRUE;
2130 ee->prop.override = EINA_TRUE; 2125 ee->prop.override = EINA_TRUE;
2131 ee->prop.maximized = EINA_FALSE; 2126 ee->prop.maximized = EINA_FALSE;
diff --git a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
index 558f82f752..adc74b1ca4 100644
--- a/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
+++ b/src/modules/ecore_evas/engines/fb/ecore_evas_fb.c
@@ -416,12 +416,10 @@ _ecore_evas_rotation_set(Ecore_Evas *ee, int rotation, int resize EINA_UNUSED)
416static void 416static void
417_ecore_evas_show(Ecore_Evas *ee) 417_ecore_evas_show(Ecore_Evas *ee)
418{ 418{
419 if (ee->prop.focused) return; 419 if (ecore_evas_focus_device_get(ee, NULL)) return;
420 ee->prop.withdrawn = EINA_FALSE; 420 ee->prop.withdrawn = EINA_FALSE;
421 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 421 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
422 ee->prop.focused = EINA_TRUE; 422 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
423 evas_focus_in(ee->evas);
424 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
425} 423}
426 424
427static void 425static void
@@ -429,12 +427,7 @@ _ecore_evas_hide(Ecore_Evas *ee)
429{ 427{
430 ee->prop.withdrawn = EINA_TRUE; 428 ee->prop.withdrawn = EINA_TRUE;
431 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 429 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
432 if (ee->prop.focused) 430 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
433 {
434 ee->prop.focused = EINA_FALSE;
435 evas_focus_out(ee->evas);
436 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
437 }
438} 431}
439 432
440static void 433static void
@@ -644,6 +637,9 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
644 NULL, // fn_animator_unregister 637 NULL, // fn_animator_unregister
645 638
646 NULL, // fn_evas_changed 639 NULL, // fn_evas_changed
640 NULL, //fn_focus_device_set
641 NULL, //fn_callback_focus_device_in_set
642 NULL, //fn_callback_focus_device_out_set
647}; 643};
648 644
649EAPI Ecore_Evas * 645EAPI Ecore_Evas *
@@ -692,7 +688,6 @@ ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
692 ee->prop.max.w = 0; 688 ee->prop.max.w = 0;
693 ee->prop.max.h = 0; 689 ee->prop.max.h = 0;
694 ee->prop.layer = 0; 690 ee->prop.layer = 0;
695 ee->prop.focused = EINA_FALSE;
696 ee->prop.borderless = EINA_TRUE; 691 ee->prop.borderless = EINA_TRUE;
697 ee->prop.override = EINA_TRUE; 692 ee->prop.override = EINA_TRUE;
698 ee->prop.maximized = EINA_TRUE; 693 ee->prop.maximized = EINA_TRUE;
diff --git a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
index 7938dce2e5..7eaf88e050 100644
--- a/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
+++ b/src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
@@ -67,10 +67,7 @@ _ecore_evas_psl1ght_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED
67 67
68 if (!ee) return ECORE_CALLBACK_PASS_ON; 68 if (!ee) return ECORE_CALLBACK_PASS_ON;
69 /* pass on event */ 69 /* pass on event */
70 ee->prop.focused = EINA_TRUE; 70 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
71 evas_focus_in(ee->evas);
72 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
73
74 return ECORE_CALLBACK_PASS_ON; 71 return ECORE_CALLBACK_PASS_ON;
75} 72}
76 73
@@ -83,10 +80,7 @@ _ecore_evas_psl1ght_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSE
83 80
84 if (!ee) return ECORE_CALLBACK_PASS_ON; 81 if (!ee) return ECORE_CALLBACK_PASS_ON;
85 /* pass on event */ 82 /* pass on event */
86 evas_focus_out(ee->evas); 83 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
87 ee->prop.focused = EINA_FALSE;
88 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
89
90 return ECORE_CALLBACK_PASS_ON; 84 return ECORE_CALLBACK_PASS_ON;
91} 85}
92 86
@@ -313,10 +307,8 @@ _ecore_evas_show(Ecore_Evas *ee)
313{ 307{
314 ee->prop.withdrawn = EINA_FALSE; 308 ee->prop.withdrawn = EINA_FALSE;
315 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 309 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
316 if (ee->prop.focused) return; 310 if (ecore_evas_focus_device_get(ee, NULL)) return;
317 ee->prop.focused = EINA_TRUE; 311 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
318 evas_focus_in(ee->evas);
319 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
320} 312}
321 313
322static void 314static void
@@ -466,6 +458,9 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
466 NULL, // fn_animator_unregister 458 NULL, // fn_animator_unregister
467 459
468 NULL, // fn_evas_changed 460 NULL, // fn_evas_changed
461 NULL, //fn_focus_device_set
462 NULL, //fn_callback_focus_device_in_set
463 NULL, //fn_callback_focus_device_out_set
469}; 464};
470 465
471EAPI Ecore_Evas * 466EAPI Ecore_Evas *
@@ -496,7 +491,6 @@ ecore_evas_psl1ght_new_internal(const char *name, int w, int h)
496 ee->prop.max.w = 0; 491 ee->prop.max.w = 0;
497 ee->prop.max.h = 0; 492 ee->prop.max.h = 0;
498 ee->prop.layer = 0; 493 ee->prop.layer = 0;
499 ee->prop.focused = EINA_TRUE;
500 ee->prop.borderless = EINA_TRUE; 494 ee->prop.borderless = EINA_TRUE;
501 ee->prop.override = EINA_TRUE; 495 ee->prop.override = EINA_TRUE;
502 ee->prop.maximized = EINA_TRUE; 496 ee->prop.maximized = EINA_TRUE;
@@ -558,6 +552,7 @@ ecore_evas_psl1ght_new_internal(const char *name, int w, int h)
558 if (getenv("ECORE_EVAS_PSL1GHT_CURSOR_PATH")) 552 if (getenv("ECORE_EVAS_PSL1GHT_CURSOR_PATH"))
559 ecore_evas_cursor_set(ee, getenv("ECORE_EVAS_PSL1GHT_CURSOR_PATH"), EVAS_LAYER_MAX, 0, 0); 553 ecore_evas_cursor_set(ee, getenv("ECORE_EVAS_PSL1GHT_CURSOR_PATH"), EVAS_LAYER_MAX, 0, 0);
560 554
555 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
561 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 556 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
562 557
563 return ee; 558 return ee;
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index 2382fdac44..e45dd0f99e 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -103,12 +103,9 @@ _ecore_evas_sdl_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED, vo
103 Ecore_Evas *ee; 103 Ecore_Evas *ee;
104 104
105 ee = _ecore_evas_sdl_match(ev->windowID); 105 ee = _ecore_evas_sdl_match(ev->windowID);
106
107 if (!ee) return ECORE_CALLBACK_PASS_ON;
108 /* pass on event */ 106 /* pass on event */
109 ee->prop.focused = EINA_TRUE; 107 if (!ee) return ECORE_CALLBACK_PASS_ON;
110 evas_focus_in(ee->evas); 108 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
111 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
112 return ECORE_CALLBACK_PASS_ON; 109 return ECORE_CALLBACK_PASS_ON;
113} 110}
114 111
@@ -122,9 +119,7 @@ _ecore_evas_sdl_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED, v
122 119
123 if (!ee) return ECORE_CALLBACK_PASS_ON; 120 if (!ee) return ECORE_CALLBACK_PASS_ON;
124 /* pass on event */ 121 /* pass on event */
125 ee->prop.focused = EINA_FALSE; 122 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
126 evas_focus_out(ee->evas);
127 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
128 return ECORE_CALLBACK_PASS_ON; 123 return ECORE_CALLBACK_PASS_ON;
129} 124}
130 125
@@ -411,8 +406,8 @@ _ecore_evas_show(Ecore_Evas *ee)
411{ 406{
412 ee->prop.withdrawn = EINA_FALSE; 407 ee->prop.withdrawn = EINA_FALSE;
413 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 408 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
414 if (ee->prop.focused) return; 409 if (ecore_evas_focus_device_get(ee, NULL)) return;
415 ee->prop.focused = EINA_TRUE; 410 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
416 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 411 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
417} 412}
418 413
@@ -555,6 +550,9 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
555 NULL, // fn_animator_unregister 550 NULL, // fn_animator_unregister
556 551
557 NULL, // fn_evas_changed 552 NULL, // fn_evas_changed
553 NULL, //fn_focus_device_set
554 NULL, //fn_callback_focus_device_in_set
555 NULL, //fn_callback_focus_device_out_set
558}; 556};
559 557
560static Ecore_Evas* 558static Ecore_Evas*
@@ -599,7 +597,6 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
599 ee->prop.max.w = 0; 597 ee->prop.max.w = 0;
600 ee->prop.max.h = 0; 598 ee->prop.max.h = 0;
601 ee->prop.layer = 0; 599 ee->prop.layer = 0;
602 ee->prop.focused = EINA_TRUE;
603 ee->prop.borderless = EINA_TRUE; 600 ee->prop.borderless = EINA_TRUE;
604 ee->prop.override = EINA_TRUE; 601 ee->prop.override = EINA_TRUE;
605 ee->prop.maximized = EINA_TRUE; 602 ee->prop.maximized = EINA_TRUE;
@@ -725,6 +722,7 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
725 ee->engine.func->fn_render = _ecore_evas_sdl_render; 722 ee->engine.func->fn_render = _ecore_evas_sdl_render;
726 _ecore_evas_register(ee); 723 _ecore_evas_register(ee);
727 724
725 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
728 ecore_evas_sdl_count++; 726 ecore_evas_sdl_count++;
729 return ee; 727 return ee;
730 728
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index 232d96b0cb..0ebff5be92 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -85,6 +85,9 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
85 NULL, // fn_animator_unregister 85 NULL, // fn_animator_unregister
86 86
87 NULL, // fn_evas_changed 87 NULL, // fn_evas_changed
88 NULL, //fn_focus_device_set
89 NULL, //fn_callback_focus_device_in_set
90 NULL, //fn_callback_focus_device_out_set
88}; 91};
89 92
90#define _smart_frame_type "ecore_evas_wl_frame" 93#define _smart_frame_type "ecore_evas_wl_frame"
@@ -207,10 +210,7 @@ _ecore_evas_wl_common_cb_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED,
207 ee = ecore_event_window_match(ev->window); 210 ee = ecore_event_window_match(ev->window);
208 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 211 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
209 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 212 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
210 if (ee->prop.focused) return ECORE_CALLBACK_PASS_ON; 213 _ecore_evas_focus_device_set(ee, ev->dev, EINA_TRUE);
211 ee->prop.focused = EINA_TRUE;
212 evas_focus_in(ee->evas);
213 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
214 return ECORE_CALLBACK_PASS_ON; 214 return ECORE_CALLBACK_PASS_ON;
215} 215}
216 216
@@ -226,10 +226,7 @@ _ecore_evas_wl_common_cb_focus_out(void *data EINA_UNUSED, int type EINA_UNUSED,
226 ee = ecore_event_window_match(ev->window); 226 ee = ecore_event_window_match(ev->window);
227 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 227 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
228 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 228 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
229 if (!ee->prop.focused) return ECORE_CALLBACK_PASS_ON; 229 _ecore_evas_focus_device_set(ee, ev->dev, EINA_FALSE);
230 evas_focus_out(ee->evas);
231 ee->prop.focused = EINA_FALSE;
232 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
233 return ECORE_CALLBACK_PASS_ON; 230 return ECORE_CALLBACK_PASS_ON;
234} 231}
235 232
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 1187d5dba2..d5107a0276 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -237,9 +237,7 @@ _ecore_evas_win32_event_window_focus_in(void *data EINA_UNUSED, int type EINA_UN
237 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 237 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
238 if ((Ecore_Window)e->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 238 if ((Ecore_Window)e->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
239 239
240 ee->prop.focused = EINA_TRUE; 240 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
241 evas_focus_in(ee->evas);
242 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
243 return ECORE_CALLBACK_PASS_ON; 241 return ECORE_CALLBACK_PASS_ON;
244} 242}
245 243
@@ -254,9 +252,7 @@ _ecore_evas_win32_event_window_focus_out(void *data EINA_UNUSED, int type EINA_U
254 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; 252 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
255 if ((Ecore_Window)e->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 253 if ((Ecore_Window)e->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
256 254
257 evas_focus_out(ee->evas); 255 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
258 ee->prop.focused = EINA_FALSE;
259 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
260 return ECORE_CALLBACK_PASS_ON; 256 return ECORE_CALLBACK_PASS_ON;
261} 257}
262 258
@@ -958,7 +954,7 @@ _ecore_evas_win32_override_set(Ecore_Evas *ee, Eina_Bool on)
958 /* FIXME: use borderless_set for now */ 954 /* FIXME: use borderless_set for now */
959 ecore_win32_window_borderless_set(window, on); 955 ecore_win32_window_borderless_set(window, on);
960 if (ee->should_be_visible) ecore_win32_window_show(window); 956 if (ee->should_be_visible) ecore_win32_window_show(window);
961 if (ee->prop.focused) ecore_win32_window_focus(window); 957 if (ecore_evas_focus_device_get(ee, NULL)) ecore_win32_window_focus(window);
962 ee->prop.override = on; 958 ee->prop.override = on;
963} 959}
964 960
@@ -1077,7 +1073,7 @@ _ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha)
1077 if (ee->prop.borderless) 1073 if (ee->prop.borderless)
1078 ecore_win32_window_borderless_set((struct _Ecore_Win32_Window *)ee->prop.window, ee->prop.borderless); 1074 ecore_win32_window_borderless_set((struct _Ecore_Win32_Window *)ee->prop.window, ee->prop.borderless);
1079 if (ee->visible) ecore_win32_window_show((struct _Ecore_Win32_Window *)ee->prop.window); 1075 if (ee->visible) ecore_win32_window_show((struct _Ecore_Win32_Window *)ee->prop.window);
1080 if (ee->prop.focused) ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window); 1076 if (ecore_evas_focus_device_get(ee, NULL)) ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window);
1081 if (ee->prop.title) 1077 if (ee->prop.title)
1082 { 1078 {
1083 ecore_win32_window_title_set((struct _Ecore_Win32_Window *)ee->prop.window, ee->prop.title); 1079 ecore_win32_window_title_set((struct _Ecore_Win32_Window *)ee->prop.window, ee->prop.title);
@@ -1206,6 +1202,9 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
1206 NULL, // fn_animator_unregister 1202 NULL, // fn_animator_unregister
1207 1203
1208 NULL, // fn_evas_changed 1204 NULL, // fn_evas_changed
1205 NULL, //fn_focus_device_set
1206 NULL, //fn_callback_focus_device_in_set
1207 NULL, //fn_callback_focus_device_out_set
1209}; 1208};
1210 1209
1211#endif /* BUILD_ECORE_EVAS_WIN32 */ 1210#endif /* BUILD_ECORE_EVAS_WIN32 */
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 2a71070e07..b86fca8f9a 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -1500,9 +1500,7 @@ _ecore_evas_x_event_window_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED
1500 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 1500 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1501//xx// filtering with these doesnt help 1501//xx// filtering with these doesnt help
1502//xx// if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON; 1502//xx// if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON;
1503 ee->prop.focused = EINA_TRUE; 1503 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
1504 evas_focus_in(ee->evas);
1505 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
1506 return ECORE_CALLBACK_PASS_ON; 1504 return ECORE_CALLBACK_PASS_ON;
1507} 1505}
1508 1506
@@ -1521,9 +1519,7 @@ _ecore_evas_x_event_window_focus_out(void *data EINA_UNUSED, int type EINA_UNUSE
1521 1519
1522// if (ee->prop.fullscreen) 1520// if (ee->prop.fullscreen)
1523// ecore_x_window_focus(ee->prop.window); 1521// ecore_x_window_focus(ee->prop.window);
1524 evas_focus_out(ee->evas); 1522 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
1525 ee->prop.focused = EINA_FALSE;
1526 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
1527 return ECORE_CALLBACK_PASS_ON; 1523 return ECORE_CALLBACK_PASS_ON;
1528} 1524}
1529 1525
@@ -2721,7 +2717,7 @@ _alpha_do(Ecore_Evas *ee, int alpha)
2721 ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless); 2717 ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
2722 if (ee->visible || ee->should_be_visible) 2718 if (ee->visible || ee->should_be_visible)
2723 ecore_x_window_show(ee->prop.window); 2719 ecore_x_window_show(ee->prop.window);
2724 if (ee->prop.focused) ecore_x_window_focus(ee->prop.window); 2720 if (ecore_evas_focus_device_get(ee, NULL)) ecore_x_window_focus(ee->prop.window);
2725 if (ee->prop.title) 2721 if (ee->prop.title)
2726 { 2722 {
2727 ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); 2723 ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
@@ -2877,7 +2873,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
2877 ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless); 2873 ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
2878 if (ee->visible || ee->should_be_visible) 2874 if (ee->visible || ee->should_be_visible)
2879 ecore_x_window_show(ee->prop.window); 2875 ecore_x_window_show(ee->prop.window);
2880 if (ee->prop.focused) ecore_x_window_focus(ee->prop.window); 2876 if (ecore_evas_focus_device_get(ee, NULL)) ecore_x_window_focus(ee->prop.window);
2881 if (ee->prop.title) 2877 if (ee->prop.title)
2882 { 2878 {
2883 ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); 2879 ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
@@ -3359,7 +3355,7 @@ _ecore_evas_x_override_set(Ecore_Evas *ee, Eina_Bool on)
3359 if (ee->should_be_visible) ecore_x_window_hide(ee->prop.window); 3355 if (ee->should_be_visible) ecore_x_window_hide(ee->prop.window);
3360 ecore_x_window_override_set(ee->prop.window, on); 3356 ecore_x_window_override_set(ee->prop.window, on);
3361 if (ee->should_be_visible) ecore_x_window_show(ee->prop.window); 3357 if (ee->should_be_visible) ecore_x_window_show(ee->prop.window);
3362 if (ee->prop.focused) ecore_x_window_focus(ee->prop.window); 3358 if (ecore_evas_focus_device_get(ee, NULL)) ecore_x_window_focus(ee->prop.window);
3363 ee->prop.override = on; 3359 ee->prop.override = on;
3364} 3360}
3365 3361
@@ -3788,6 +3784,9 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
3788 NULL, // fn_animator_unregister 3784 NULL, // fn_animator_unregister
3789 3785
3790 NULL, // fn_evas_changed 3786 NULL, // fn_evas_changed
3787 NULL, //fn_focus_device_set
3788 NULL, //fn_callback_focus_device_in_set
3789 NULL, //fn_callback_focus_device_out_set
3791}; 3790};
3792 3791
3793/* 3792/*