summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
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/lib/ecore_evas
parent6b95c4c2eccff5976992b9a4d557e586d90511d1 (diff)
Ecore_Evas: Add support for per-seat focus.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h66
-rw-r--r--src/lib/ecore_evas/Ecore_Evas_Types.h1
-rw-r--r--src/lib/ecore_evas/ecore_evas.c108
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c22
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c20
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h12
6 files changed, 191 insertions, 38 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 45dd047ca3..096cb9002f 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -314,7 +314,7 @@ EAPI void ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, i
314 */ 314 */
315EAPI void ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h); 315EAPI void ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
316/** 316/**
317 * @brief Set the focus of an Ecore_Evas' window. 317 * @brief Set the Ecore_Evas window focus for the default seat.
318 * 318 *
319 * @param ee The Ecore_Evas 319 * @param ee The Ecore_Evas
320 * @param on @c EINA_TRUE for focus, @c EINA_FALSE to defocus. 320 * @param on @c EINA_TRUE for focus, @c EINA_FALSE to defocus.
@@ -323,17 +323,47 @@ EAPI void ecore_evas_request_geometry_get(const Ecore_Evas *ee, int *x, i
323 * @p on is @c EINA_FALSE. 323 * @p on is @c EINA_FALSE.
324 * 324 *
325 * @warning Support for this depends on the underlying windowing system. 325 * @warning Support for this depends on the underlying windowing system.
326 * @see ecore_evas_focus_device_set()
326 */ 327 */
327EAPI void ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on); 328EAPI void ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on);
328/** 329/**
329 * @brief Query whether an Ecore_Evas' window is focused or not. 330 * @brief Query whether the default seat has the Ecore_Evas focus.
330 * 331 *
331 * @param ee The Ecore_Evas to set 332 * @param ee The Ecore_Evas to set
332 * @return @c EINA_TRUE if @p ee if focused, @c EINA_FALSE if not. 333 * @return @c EINA_TRUE if @p ee if focused, @c EINA_FALSE if not.
333 * 334 *
334 * @see ecore_evas_focus_set() 335 * @see ecore_evas_focus_set()
336 * @see ecore_evas_focus_device_get()
335 */ 337 */
336EAPI Eina_Bool ecore_evas_focus_get(const Ecore_Evas *ee); 338EAPI Eina_Bool ecore_evas_focus_get(const Ecore_Evas *ee);
339
340/**
341 * @brief Set the Ecore_Evas windows focus for a given seat.
342 *
343 * @param ee The Ecore_Evas
344 * @param seat An Efl_Input_Device that represents the seat or @c NULL for the default seat.
345 * @param on @c EINA_TRUE for focus, @c EINA_FALSE to defocus.
346 *
347 * This function focuses @p ee if @p on is @c EINA_TRUE, or unfocuses @p ee if
348 * @p on is @c EINA_FALSE.
349 *
350 * @warning Support for this depends on the underlying windowing system.
351 * @see ecore_evas_focus_device_get()
352 * @since 1.19
353 */
354EAPI void ecore_evas_focus_device_set(Ecore_Evas *ee, Eo *seat,
355 Eina_Bool on);
356/**
357 * @brief Query whether an Ecore_Evas' window is focused or not.
358 *
359 * @param ee The Ecore_Evas to set
360 * @param seat An Efl_Input_Device that represents the seat or @c NULL for the default seat.
361 * @return @c EINA_TRUE if @p ee if focused, @c EINA_FALSE if not.
362 *
363 * @see ecore_evas_focus_device_set()
364 * @since 1.19
365 */
366EAPI Eina_Bool ecore_evas_focus_device_get(const Ecore_Evas *ee, Eo *seat);
337/** 367/**
338 * @brief Iconify or uniconify an Ecore_Evas' window. 368 * @brief Iconify or uniconify an Ecore_Evas' window.
339 * 369 *
@@ -1751,6 +1781,8 @@ EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Even
1751 * 1781 *
1752 * @warning If and when this function is called depends on the underlying 1782 * @warning If and when this function is called depends on the underlying
1753 * windowing system. 1783 * windowing system.
1784 * @note This function only reports focus in events for the default seat!
1785 * @see ecore_evas_callback_focus_device_in_set()
1754 */ 1786 */
1755EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); 1787EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1756/** 1788/**
@@ -1763,9 +1795,39 @@ EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Eve
1763 * 1795 *
1764 * @warning If and when this function is called depends on the underlying 1796 * @warning If and when this function is called depends on the underlying
1765 * windowing system. 1797 * windowing system.
1798 * @note This function only reports focus in events for the default seat!
1799 * @see ecore_evas_callback_focus_device_out_set()
1766 */ 1800 */
1767EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func); 1801EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
1768/** 1802/**
1803 * @brief Set a callback for Ecore_Evas focus in events.
1804 * @param ee The Ecore_Evas to set callbacks on
1805 * @param func The function to call
1806
1807 * A call to this function will set a callback on an Ecore_Evas, causing
1808 * @p func to be called whenever @p ee gets focus.
1809 *
1810 * @warning If and when this function is called depends on the underlying
1811 * windowing system.
1812 * @see ecore_evas_callback_focus_device_out_set()
1813 * @since 1.19
1814 */
1815EAPI void ecore_evas_callback_focus_device_in_set(Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func);
1816/**
1817 * @brief Set a callback for Ecore_Evas focus out events.
1818 * @param ee The Ecore_Evas to set callbacks on
1819 * @param func The function to call
1820
1821 * A call to this function will set a callback on an Ecore_Evas, causing
1822 * @p func to be called whenever @p ee loses focus.
1823 *
1824 * @warning If and when this function is called depends on the underlying
1825 * windowing system.
1826 * @see ecore_evas_callback_focus_device_in_set()
1827 * @since 1.19
1828 */
1829EAPI void ecore_evas_callback_focus_device_out_set(Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func);
1830/**
1769 * @brief Set a callback for Ecore_Evas sticky events. 1831 * @brief Set a callback for Ecore_Evas sticky events.
1770 * @param ee The Ecore_Evas to set callbacks on 1832 * @param ee The Ecore_Evas to set callbacks on
1771 * @param func The function to call 1833 * @param func The function to call
diff --git a/src/lib/ecore_evas/Ecore_Evas_Types.h b/src/lib/ecore_evas/Ecore_Evas_Types.h
index eeff920f81..e84a674b39 100644
--- a/src/lib/ecore_evas/Ecore_Evas_Types.h
+++ b/src/lib/ecore_evas/Ecore_Evas_Types.h
@@ -41,6 +41,7 @@ typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
41/* basic data types */ 41/* basic data types */
42typedef struct _Ecore_Evas Ecore_Evas; 42typedef struct _Ecore_Evas Ecore_Evas;
43typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */ 43typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
44typedef void (*Ecore_Evas_Focus_Device_Event_Cb) (Ecore_Evas *ee, Eo *seat); /** Callback used to report an focus in/out event originated from a seat. @since 1.19*/
44#endif 45#endif
45 46
46#ifndef _ECORE_WAYLAND_H_ 47#ifndef _ECORE_WAYLAND_H_
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 421345daa9..ae3fed8ded 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -66,6 +66,23 @@ static int _ecore_evas_fps_debug = 0;
66static int _ecore_evas_render_sync = 1; 66static int _ecore_evas_render_sync = 1;
67 67
68static void 68static void
69_ecore_evas_focus_out_dispatch(Ecore_Evas *ee, Efl_Input_Device *seat)
70{
71 evas_canvas_seat_focus_out(ee->evas, seat);
72 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
73 if (ee->func.fn_focus_device_out) ee->func.fn_focus_device_out(ee, seat);
74}
75
76static void
77_ecore_evas_device_del_cb(void *data, const Efl_Event *ev)
78{
79 Ecore_Evas *ee = data;
80
81 ee->prop.focused_by = eina_list_remove(ee->prop.focused_by, ev->object);
82 _ecore_evas_focus_out_dispatch(ee, ev->object);
83}
84
85static void
69_ecore_evas_animator(void *data, const Efl_Event *ev EINA_UNUSED) 86_ecore_evas_animator(void *data, const Efl_Event *ev EINA_UNUSED)
70{ 87{
71 Ecore_Evas *ee = data; 88 Ecore_Evas *ee = data;
@@ -1005,6 +1022,16 @@ ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1005} 1022}
1006 1023
1007EAPI void 1024EAPI void
1025ecore_evas_callback_focus_device_in_set(Ecore_Evas *ee,
1026 Ecore_Evas_Focus_Device_Event_Cb func)
1027{
1028 ECORE_EVAS_CHECK(ee);
1029 IFC(ee, fn_callback_focus_device_in_set) (ee, func);
1030 IFE;
1031 ee->func.fn_focus_device_in = func;
1032}
1033
1034EAPI void
1008ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) 1035ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1009{ 1036{
1010 ECORE_EVAS_CHECK(ee); 1037 ECORE_EVAS_CHECK(ee);
@@ -1014,6 +1041,16 @@ ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1014} 1041}
1015 1042
1016EAPI void 1043EAPI void
1044ecore_evas_callback_focus_device_out_set(Ecore_Evas *ee,
1045 Ecore_Evas_Focus_Device_Event_Cb func)
1046{
1047 ECORE_EVAS_CHECK(ee);
1048 IFC(ee, fn_callback_focus_device_out_set) (ee, func);
1049 IFE;
1050 ee->func.fn_focus_device_out = func;
1051}
1052
1053EAPI void
1017ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func) 1054ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1018{ 1055{
1019 ECORE_EVAS_CHECK(ee); 1056 ECORE_EVAS_CHECK(ee);
@@ -1553,30 +1590,75 @@ ecore_evas_layer_get(const Ecore_Evas *ee)
1553 return ee->prop.layer; 1590 return ee->prop.layer;
1554} 1591}
1555 1592
1593EAPI Eina_Bool
1594ecore_evas_focus_device_get(const Ecore_Evas *ee, Efl_Input_Device *seat)
1595{
1596 ECORE_EVAS_CHECK(ee, EINA_FALSE);
1597 if (!seat)
1598 seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
1599 return eina_list_data_find(ee->prop.focused_by, seat) ? EINA_TRUE : EINA_FALSE;
1600}
1601
1556EAPI void 1602EAPI void
1557ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on) 1603_ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
1604 Eina_Bool on)
1558{ 1605{
1559 ECORE_EVAS_CHECK(ee); 1606 Eina_Bool present;
1560 IFC(ee, fn_focus_set) (ee, on); 1607
1561 IFE; 1608 if (!seat)
1609 seat = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_CLASS_SEAT);
1610 EINA_SAFETY_ON_NULL_RETURN(seat);
1611
1612 if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_SEAT)
1613 {
1614 ERR("The Input device must be an seat");
1615 return;
1616 }
1617
1618 present = ecore_evas_focus_device_get(ee, seat);
1562 if (on) 1619 if (on)
1563 { 1620 {
1564 evas_focus_in(ee->evas); 1621 if (present) return;
1622 ee->prop.focused_by = eina_list_append(ee->prop.focused_by, seat);
1623 efl_event_callback_add(seat, EFL_EVENT_DEL,
1624 _ecore_evas_device_del_cb, ee);
1625 evas_canvas_seat_focus_in(ee->evas, seat);
1565 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee); 1626 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
1627 if (ee->func.fn_focus_device_in) ee->func.fn_focus_device_in(ee, seat);
1566 } 1628 }
1567 else 1629 else
1568 { 1630 {
1569 evas_focus_out(ee->evas); 1631 if (!present) return;
1570 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee); 1632 ee->prop.focused_by = eina_list_remove(ee->prop.focused_by, seat);
1633 efl_event_callback_del(seat, EFL_EVENT_DEL,
1634 _ecore_evas_device_del_cb, ee);
1635 _ecore_evas_focus_out_dispatch(ee, seat);
1571 } 1636 }
1572 ee->prop.focused = !!on; 1637}
1638
1639EAPI void
1640ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
1641 Eina_Bool on)
1642{
1643 ECORE_EVAS_CHECK(ee);
1644 IFC(ee, fn_focus_device_set) (ee, seat, on);
1645 IFE;
1646 _ecore_evas_focus_device_set(ee, seat, on);
1647}
1648
1649EAPI void
1650ecore_evas_focus_set(Ecore_Evas *ee, Eina_Bool on)
1651{
1652 ECORE_EVAS_CHECK(ee);
1653 IFC(ee, fn_focus_set) (ee, on);
1654 IFE;
1655 ecore_evas_focus_device_set(ee, NULL, on);
1573} 1656}
1574 1657
1575EAPI Eina_Bool 1658EAPI Eina_Bool
1576ecore_evas_focus_get(const Ecore_Evas *ee) 1659ecore_evas_focus_get(const Ecore_Evas *ee)
1577{ 1660{
1578 ECORE_EVAS_CHECK(ee, EINA_FALSE); 1661 return ecore_evas_focus_device_get(ee, NULL);
1579 return ee->prop.focused ? EINA_TRUE : EINA_FALSE;
1580} 1662}
1581 1663
1582EAPI void 1664EAPI void
@@ -2672,6 +2754,7 @@ _ecore_evas_vnc_stop(Ecore_Evas *ee)
2672EAPI void 2754EAPI void
2673_ecore_evas_free(Ecore_Evas *ee) 2755_ecore_evas_free(Ecore_Evas *ee)
2674{ 2756{
2757 Efl_Input_Device *seat;
2675 Ecore_Evas_Interface *iface; 2758 Ecore_Evas_Interface *iface;
2676 2759
2677 ee->deleted = EINA_TRUE; 2760 ee->deleted = EINA_TRUE;
@@ -2695,6 +2778,11 @@ _ecore_evas_free(Ecore_Evas *ee)
2695 { 2778 {
2696 _ecore_evas_free(ee->sub_ecore_evas->data); 2779 _ecore_evas_free(ee->sub_ecore_evas->data);
2697 } 2780 }
2781 EINA_LIST_FREE(ee->prop.focused_by, seat)
2782 {
2783 efl_event_callback_del(seat, EFL_EVENT_DEL,
2784 _ecore_evas_device_del_cb, ee);
2785 }
2698 if (ee->data) eina_hash_free(ee->data); 2786 if (ee->data) eina_hash_free(ee->data);
2699 ee->data = NULL; 2787 ee->data = NULL;
2700 if (ee->name) free(ee->name); 2788 if (ee->name) free(ee->name);
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index deb2387001..ae9fb62646 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -105,12 +105,10 @@ _ecore_evas_show(Ecore_Evas *ee)
105 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data; 105 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
106 106
107 if (bdata->image) return; 107 if (bdata->image) return;
108 if (ee->prop.focused) return; 108 if (ecore_evas_focus_device_get(ee, NULL)) return;
109 ee->prop.focused = EINA_TRUE;
110 ee->prop.withdrawn = EINA_FALSE; 109 ee->prop.withdrawn = EINA_FALSE;
111 if (ee->func.fn_state_change) ee->func.fn_state_change(ee); 110 if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
112 evas_focus_in(ee->evas); 111 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
113 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
114} 112}
115 113
116static int 114static int
@@ -413,9 +411,7 @@ _ecore_evas_buffer_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
413 Ecore_Evas *ee; 411 Ecore_Evas *ee;
414 412
415 ee = data; 413 ee = data;
416 ee->prop.focused = EINA_TRUE; 414 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
417 evas_focus_in(ee->evas);
418 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
419} 415}
420 416
421static void 417static void
@@ -424,9 +420,7 @@ _ecore_evas_buffer_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *ob
424 Ecore_Evas *ee; 420 Ecore_Evas *ee;
425 421
426 ee = data; 422 ee = data;
427 ee->prop.focused = EINA_FALSE; 423 _ecore_evas_focus_device_set(ee, NULL, EINA_FALSE);
428 evas_focus_out(ee->evas);
429 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
430} 424}
431 425
432static void 426static void
@@ -608,6 +602,9 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
608 NULL, // fn_animator_unregister 602 NULL, // fn_animator_unregister
609 603
610 NULL, // fn_evas_changed 604 NULL, // fn_evas_changed
605 NULL, //fn_focus_device_set
606 NULL, //fn_callback_focus_device_in_set
607 NULL, //fn_callback_focus_device_out_set
611}; 608};
612 609
613static void * 610static void *
@@ -672,7 +669,6 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
672 ee->prop.max.w = 0; 669 ee->prop.max.w = 0;
673 ee->prop.max.h = 0; 670 ee->prop.max.h = 0;
674 ee->prop.layer = 0; 671 ee->prop.layer = 0;
675 ee->prop.focused = EINA_TRUE;
676 ee->prop.borderless = EINA_TRUE; 672 ee->prop.borderless = EINA_TRUE;
677 ee->prop.override = EINA_TRUE; 673 ee->prop.override = EINA_TRUE;
678 ee->prop.maximized = EINA_TRUE; 674 ee->prop.maximized = EINA_TRUE;
@@ -727,7 +723,8 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
727 _ecore_evas_register(ee); 723 _ecore_evas_register(ee);
728 724
729 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 725 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
730 726 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
727
731 return ee; 728 return ee;
732} 729}
733 730
@@ -811,7 +808,6 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
811 ee->prop.max.w = 0; 808 ee->prop.max.w = 0;
812 ee->prop.max.h = 0; 809 ee->prop.max.h = 0;
813 ee->prop.layer = 0; 810 ee->prop.layer = 0;
814 ee->prop.focused = EINA_FALSE;
815 ee->prop.borderless = EINA_TRUE; 811 ee->prop.borderless = EINA_TRUE;
816 ee->prop.override = EINA_TRUE; 812 ee->prop.override = EINA_TRUE;
817 ee->prop.maximized = EINA_FALSE; 813 ee->prop.maximized = EINA_FALSE;
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index 6f90654f6b..c7dcb7087f 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -465,19 +465,11 @@ static void
465_ecore_evas_ews_focus_set(Ecore_Evas *ee, Eina_Bool on) 465_ecore_evas_ews_focus_set(Ecore_Evas *ee, Eina_Bool on)
466{ 466{
467 evas_object_focus_set(ee->engine.ews.image, on); 467 evas_object_focus_set(ee->engine.ews.image, on);
468 ee->prop.focused = on; 468 _ecore_evas_focus_device_set(ee, NULL, on);
469 if (on) 469 if (on)
470 { 470 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_FOCUS);
471 evas_focus_in(ee->evas);
472 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
473 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_FOCUS);
474 }
475 else 471 else
476 { 472 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_UNFOCUS);
477 evas_focus_out(ee->evas);
478 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
479 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_UNFOCUS);
480 }
481} 473}
482 474
483static void 475static void
@@ -501,7 +493,8 @@ _ecore_evas_ews_override_set(Ecore_Evas *ee, Eina_Bool on)
501{ 493{
502 if (ee->prop.override == on) return; 494 if (ee->prop.override == on) return;
503 if (ee->visible) evas_object_show(ee->engine.ews.image); 495 if (ee->visible) evas_object_show(ee->engine.ews.image);
504 if (ee->prop.focused) evas_object_focus_set(ee->engine.ews.image, EINA_TRUE); 496 if (ecore_evas_focus_device_get(ee, NULL))
497 evas_object_focus_set(ee->engine.ews.image, EINA_TRUE);
505 ee->prop.override = on; 498 ee->prop.override = on;
506 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE); 499 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
507} 500}
@@ -721,6 +714,9 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
721 NULL, // fn_animator_unregister 714 NULL, // fn_animator_unregister
722 715
723 NULL, // fn_evas_changed 716 NULL, // fn_evas_changed
717 NULL, //fn_focus_device_set
718 NULL, //fn_callback_focus_device_in_set
719 NULL, //fn_callback_focus_device_out_set
724}; 720};
725 721
726void 722void
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 5184e94d2b..af1c5319f6 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -158,6 +158,10 @@ struct _Ecore_Evas_Engine_Func
158 void (*fn_animator_unregister)(Ecore_Evas *ee); 158 void (*fn_animator_unregister)(Ecore_Evas *ee);
159 159
160 void (*fn_evas_changed)(Ecore_Evas *ee, Eina_Bool changed); 160 void (*fn_evas_changed)(Ecore_Evas *ee, Eina_Bool changed);
161
162 void (*fn_focus_device_set) (Ecore_Evas *ee, Efl_Input_Device *seat, Eina_Bool on);
163 void (*fn_callback_focus_device_in_set) (Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func);
164 void (*fn_callback_focus_device_out_set) (Ecore_Evas *ee, Ecore_Evas_Focus_Device_Event_Cb func);
161}; 165};
162 166
163struct _Ecore_Evas_Interface 167struct _Ecore_Evas_Interface
@@ -257,13 +261,13 @@ struct _Ecore_Evas
257 Eina_List *hints; 261 Eina_List *hints;
258 int id; 262 int id;
259 } aux_hint; 263 } aux_hint;
264 Eina_List *focused_by;
260 int layer; 265 int layer;
261 Ecore_Window window; 266 Ecore_Window window;
262 unsigned char avoid_damage; 267 unsigned char avoid_damage;
263 Ecore_Evas *group_ee; 268 Ecore_Evas *group_ee;
264 Ecore_Window group_ee_win; 269 Ecore_Window group_ee_win;
265 double aspect; 270 double aspect;
266 Eina_Bool focused : 1;
267 Eina_Bool iconified : 1; 271 Eina_Bool iconified : 1;
268 Eina_Bool borderless : 1; 272 Eina_Bool borderless : 1;
269 Eina_Bool override : 1; 273 Eina_Bool override : 1;
@@ -300,6 +304,8 @@ struct _Ecore_Evas
300 void (*fn_msg_handle) (Ecore_Evas *ee, int maj, int min, void *data, int size); 304 void (*fn_msg_handle) (Ecore_Evas *ee, int maj, int min, void *data, int size);
301 void (*fn_pointer_xy_get) (const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y); 305 void (*fn_pointer_xy_get) (const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y);
302 Eina_Bool (*fn_pointer_warp) (const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y); 306 Eina_Bool (*fn_pointer_warp) (const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y);
307 void (*fn_focus_device_in) (Ecore_Evas *ee, Efl_Input_Device *seat);
308 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat);
303 } func; 309 } func;
304 310
305 Ecore_Evas_Engine engine; 311 Ecore_Evas_Engine engine;
@@ -445,6 +451,10 @@ EAPI void ecore_evas_animator_tick(Ecore_Evas *ee, Eina_Rectangle *viewport, dou
445 451
446Eina_Module *_ecore_evas_vnc_server_module_load(void); 452Eina_Module *_ecore_evas_vnc_server_module_load(void);
447 453
454
455EAPI void _ecore_evas_focus_device_set(Ecore_Evas *ee, Efl_Input_Device *seat,
456 Eina_Bool on);
457
448#undef EAPI 458#undef EAPI
449#define EAPI 459#define EAPI
450 460