devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=639a1a24ae98fcacb05d5b1e356702d4c5c91d79

commit 639a1a24ae98fcacb05d5b1e356702d4c5c91d79
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Sep 9 12:08:26 2015 -0400

    ecore-wl2: Add API function to hide a window
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/Ecore_Wl2.h        |  9 +++++++++
 src/lib/ecore_wl2/ecore_wl2_window.c | 19 +++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 1d28dd7..cf24f37 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -265,6 +265,15 @@ EAPI struct wl_surface 
*ecore_wl2_window_surface_get(Ecore_Wl2_Window *window);
  */
 EAPI void ecore_wl2_window_show(Ecore_Wl2_Window *window);
 
+/**
+ * Hide a given Ecore_Wl2_Window
+ *
+ * @param window The Ecore_Wl2_Window to hide
+ *
+ * @ingroup Ecore_Wl2_Window_Group
+ */
+EAPI void ecore_wl2_window_hide(Ecore_Wl2_Window *window);
+
 /* # ifdef __cplusplus */
 /* } */
 /* # endif */
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index 060b729..eb2ee8d 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -263,3 +263,22 @@ ecore_wl2_window_show(Ecore_Wl2_Window *window)
 surf_err:
    ERR("Failed to create surface for window: %m");
 }
+
+EAPI void
+ecore_wl2_window_hide(Ecore_Wl2_Window *window)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface);
+   window->xdg_surface = NULL;
+
+   if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup);
+   window->xdg_popup = NULL;
+
+   if (window->wl_shell_surface)
+     wl_shell_surface_destroy(window->wl_shell_surface);
+   window->wl_shell_surface = NULL;
+
+   if (window->surface) wl_surface_destroy(window->surface);
+   window->surface = NULL;
+}

-- 


Reply via email to