summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/sdl
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/ecore_evas/engines/sdl
parent6b95c4c2eccff5976992b9a4d557e586d90511d1 (diff)
Ecore_Evas: Add support for per-seat focus.
Diffstat (limited to 'src/modules/ecore_evas/engines/sdl')
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c20
1 files changed, 9 insertions, 11 deletions
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