discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=a6a93c05b406902cb7007f78257dad9d2e1cdbc9
commit a6a93c05b406902cb7007f78257dad9d2e1cdbc9 Author: discomfitor <michael.blumenkra...@gmail.com> Date: Sat Oct 19 12:13:28 2013 +0100 feature: function for getting top visible client on current desk this is a pretty useful function overall, and I found that I was duplicating its functionality in a number of places, so I broke it out --- src/bin/e_desk.c | 13 +++++++++++++ src/bin/e_desk.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index c6861e0..cc9fb2a 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -106,6 +106,19 @@ e_desk_new(E_Zone *zone, int x, int y) return desk; } +EAPI E_Client * +e_desk_client_top_visible_get(const E_Desk *desk) +{ + E_Client *ec; + + E_OBJECT_CHECK_RETURN(desk, NULL); + E_OBJECT_TYPE_CHECK_RETURN(desk, E_DESK_TYPE, NULL); + + E_CLIENT_REVERSE_FOREACH(e_comp_get(desk), ec) + if (e_client_util_desk_visible(ec, desk) && evas_object_visible_get(ec->frame)) return ec; + return NULL; +} + EAPI void e_desk_name_set(E_Desk *desk, const char *name) { diff --git a/src/bin/e_desk.h b/src/bin/e_desk.h index 29a90f2..dc847ab 100644 --- a/src/bin/e_desk.h +++ b/src/bin/e_desk.h @@ -74,6 +74,7 @@ EAPI void e_desk_name_update(void); EAPI void e_desk_show(E_Desk *desk); EAPI void e_desk_deskshow(E_Zone *zone); EAPI E_Client *e_desk_last_focused_focus(E_Desk *desk); +EAPI E_Client *e_desk_client_top_visible_get(const E_Desk *desk); EAPI E_Desk *e_desk_current_get(E_Zone *zone); EAPI E_Desk *e_desk_at_xy_get(E_Zone *zone, int x, int y); EAPI E_Desk *e_desk_at_pos_get(E_Zone *zone, int pos); --