devilhorns pushed a commit to branch master.

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

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

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

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 8205dc3..6c51208 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -403,6 +403,8 @@ EAPI void ecore_wl2_window_maximized_set(Ecore_Wl2_Window 
*window, Eina_Bool max
 /* TODO: doxy */
 EAPI Eina_Bool ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window);
 
+EAPI void ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool 
fullscreen);
+
 /* TODO: doxy */
 EAPI void ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int 
rotation);
 
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index 255051e..77e83ed 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -635,6 +635,38 @@ ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window)
 }
 
 EAPI void
+ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if ((window->type == ECORE_WL2_WINDOW_TYPE_FULLSCREEN) == fullscreen)
+     return;
+
+   if (fullscreen)
+     {
+        if (window->xdg_surface)
+          xdg_surface_set_fullscreen(window->xdg_surface, NULL);
+        else if (window->wl_shell_surface)
+          wl_shell_surface_set_fullscreen(window->wl_shell_surface,
+                                          
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
+                                          0, NULL);
+
+        window->type = ECORE_WL2_WINDOW_TYPE_FULLSCREEN;
+     }
+   else
+     {
+        if (window->xdg_surface)
+          xdg_surface_unset_fullscreen(window->xdg_surface);
+        else if (window->wl_shell_surface)
+          wl_shell_surface_set_toplevel(window->wl_shell_surface);
+
+        window->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
+     }
+
+   /* TODO: send configure ? */
+}
+
+EAPI void
 ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int rotation)
 {
    EINA_SAFETY_ON_NULL_RETURN(window);

-- 


Reply via email to