devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=873b917e9e97026b42f51c7ae7d03f4bc022eb55

commit 873b917e9e97026b42f51c7ae7d03f4bc022eb55
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Jun 27 09:17:36 2017 -0400

    ecore-wl2: Add client-side event for Window Show
    
    Small patch to add and send a client-side event for when a window gets
    shown.
    
    '#divergence'
    
    @feature
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/Ecore_Wl2.h        |  8 ++++++++
 src/lib/ecore_wl2/ecore_wl2.c        |  5 ++++-
 src/lib/ecore_wl2/ecore_wl2_window.c | 16 ++++++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 9b02f1db0a..52a140c1e8 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -288,6 +288,13 @@ typedef struct _Ecore_Wl2_Event_Window_Rotation 
Ecore_Wl2_Event_Window_Rotation_
 typedef struct _Ecore_Wl2_Event_Window_Rotation 
Ecore_Wl2_Event_Window_Rotation_Change_Request;
 typedef struct _Ecore_Wl2_Event_Window_Rotation 
Ecore_Wl2_Event_Window_Rotation_Change_Done;
 
+typedef struct _Ecore_Wl2_Event_Window_Show
+{
+   unsigned int win;
+   unsigned int parent_win;
+   unsigned int event_win;
+} Ecore_Wl2_Event_Window_Show;
+
 typedef enum _Ecore_Wl2_Window_Type
 {
    ECORE_WL2_WINDOW_TYPE_NONE,
@@ -341,6 +348,7 @@ EAPI extern int 
ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE_DONE; /** @since
 EAPI extern int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_REQUEST; /** @since 
1.20 */
 EAPI extern int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE; /** @since 1.20 */
 EAPI extern int ECORE_WL2_EVENT_AUX_HINT_ALLOWED; /** @since 1.20 */
+EAPI extern int ECORE_WL2_EVENT_WINDOW_SHOW; /** @since 1.20 */
 
 /**
  * @file
diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c
index c96ece51b2..bb3b00a1a0 100644
--- a/src/lib/ecore_wl2/ecore_wl2.c
+++ b/src/lib/ecore_wl2/ecore_wl2.c
@@ -46,6 +46,7 @@ EAPI int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE_DONE 
= 0;
 EAPI int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_REQUEST = 0;
 EAPI int ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE = 0;
 EAPI int ECORE_WL2_EVENT_AUX_HINT_ALLOWED = 0;
+EAPI int ECORE_WL2_EVENT_WINDOW_SHOW = 0;
 
 EAPI int _ecore_wl2_event_window_www = -1;
 EAPI int _ecore_wl2_event_window_www_drag = -1;
@@ -122,6 +123,7 @@ ecore_wl2_init(void)
         ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_REQUEST = 
ecore_event_type_new();
         ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE = ecore_event_type_new();
         ECORE_WL2_EVENT_AUX_HINT_ALLOWED = ecore_event_type_new();
+        ECORE_WL2_EVENT_WINDOW_SHOW = ecore_event_type_new();
      }
    if (!no_session_recovery)
      no_session_recovery = !!getenv("EFL_NO_WAYLAND_SESSION_RECOVERY");
@@ -185,7 +187,8 @@ ecore_wl2_shutdown(void)
                           ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_PREPARE_DONE,
                           ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_REQUEST,
                           ECORE_WL2_EVENT_WINDOW_ROTATION_CHANGE_DONE,
-                          ECORE_WL2_EVENT_AUX_HINT_ALLOWED);
+                          ECORE_WL2_EVENT_AUX_HINT_ALLOWED,
+                          ECORE_WL2_EVENT_WINDOW_SHOW);
 
    /* shutdown Ecore_Event */
    ecore_event_shutdown();
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index 86e5939f4a..e0e1977c98 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -526,6 +526,21 @@ _ecore_wl2_aux_hint_free(Ecore_Wl2_Aux_Hint *ehint)
    free(ehint);
 }
 
+static void
+_ecore_wl2_window_show_send(Ecore_Wl2_Window *window)
+{
+   Ecore_Wl2_Event_Window_Show *ev;
+
+   ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Show));
+   if (!ev) return;
+
+   ev->win = window->id;
+   if (window->parent)
+     ev->parent_win = window->parent->id;
+   ev->event_win = window->id;
+   ecore_event_add(ECORE_WL2_EVENT_WINDOW_SHOW, ev, NULL, NULL);
+}
+
 EAPI Ecore_Wl2_Window *
 ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int 
x, int y, int w, int h)
 {
@@ -608,6 +623,7 @@ ecore_wl2_window_show(Ecore_Wl2_Window *window)
      {
         _ecore_wl2_window_shell_surface_init(window);
         _ecore_wl2_window_www_surface_init(window);
+        _ecore_wl2_window_show_send(window);
      }
    else
      window->pending.configure = EINA_FALSE;

-- 


Reply via email to