zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2754b24cdd2901e839a070e88b899907a1496406

commit 2754b24cdd2901e839a070e88b899907a1496406
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Thu Mar 12 12:16:04 2020 -0400

    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
---
 src/lib/efl_wl/efl_wl.c  | 22 ++++++++++++++++++++++
 src/lib/efl_wl/efl_wl.eo |  9 +++++++++
 2 files changed, 31 insertions(+)

diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index 84a61e83ae..56efb5c6d7 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -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)
 {
diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo
index af7f79393c..b41b429871 100644
--- a/src/lib/efl_wl/efl_wl.eo
+++ b/src/lib/efl_wl/efl_wl.eo
@@ -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;

-- 


Reply via email to