efl-wl: add active_surface property

Summary:
this is probably useful?

Depends on D11469

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11470
This commit is contained in:
Mike Blumenkrantz 2020-03-12 12:16:04 -04:00
parent 09aba19cc9
commit 2754b24cdd
2 changed files with 31 additions and 0 deletions

View File

@ -5620,6 +5620,28 @@ _efl_wl_surface_prev(Eo *obj, Comp *c)
return NULL;
}
EOLIAN static Eo *
_efl_wl_active_surface_get(const Eo *obj, Comp *c)
{
if (c->active_surface && (!c->active_surface->dead))
return c->active_surface->obj;
return NULL;
}
EOLIAN static Eina_Bool
_efl_wl_active_surface_set(Eo *obj, Comp *c, Eo *surface)
{
Comp_Surface *cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(cs, EINA_FALSE);
if (cs->dead) return EINA_FALSE;
if (c->active_surface == cs) return EINA_TRUE;
/* can't activate a popup */
if (cs->shell.popup) return EINA_FALSE;
cs->shell.activated = 1;
shell_surface_send_configure(cs);
return EINA_TRUE;
}
EOLIAN static void
_efl_wl_rotation_get(const Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation *rotation, Eina_Bool *rtl)
{

View File

@ -59,6 +59,15 @@ class @beta Efl.Wl extends Efl.Canvas.Group
surface_prev {
return: Efl.Wl.Surface;
}
@property active_surface {
get {}
set {
return: bool;
}
values {
surface: Efl.Wl.Surface;
}
}
@property aspect {
values {
set: bool;