devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9a008a9a69dd04153cbcb7fa10c59df0d8be6ac9

commit 9a008a9a69dd04153cbcb7fa10c59df0d8be6ac9
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Sep 28 11:43:20 2015 -0400

    ecore-wl2: Add API function to set window minimized state
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/Ecore_Wl2.h        |  3 +++
 src/lib/ecore_wl2/ecore_wl2_window.c | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 87424ed..c1b8407 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -423,6 +423,9 @@ EAPI void ecore_wl2_window_geometry_set(Ecore_Wl2_Window 
*window, int x, int y,
 /* TODO: doxy */
 EAPI Eina_Bool ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window);
 
+/* TODO: doxy */
+EAPI void ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool 
iconified);
+
 /* # ifdef __cplusplus */
 /* } */
 /* # endif */
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index 19bc7d2..6ed7991 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -738,3 +738,37 @@ ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window)
 
    return window->minimized;
 }
+
+EAPI void
+ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if (window->minimized == iconified) return;
+
+   if (iconified)
+     {
+        if (window->xdg_surface)
+          xdg_surface_set_minimized(window->xdg_surface);
+     }
+   else
+     {
+        if (window->xdg_surface)
+          {
+             struct wl_array states;
+             uint32_t *s;
+
+             wl_array_init(&states);
+             s = wl_array_add(&states, sizeof(*s));
+             *s = XDG_SURFACE_STATE_ACTIVATED;
+             _xdg_surface_cb_configure(window, window->xdg_surface,
+                                       window->geometry.w, window->geometry.h,
+                                       &states, 0);
+             wl_array_release(&states);
+          }
+
+        window->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
+     }
+
+   window->minimized = iconified;
+}

-- 


Reply via email to