ecore-wl2: Add API function to set if a window is transparent
authorChris Michael <cp.michael@samsung.com>
Mon, 28 Sep 2015 13:36:34 +0000 (09:36 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 3 Dec 2015 17:02:40 +0000 (12:02 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/ecore_wl2_private.h
src/lib/ecore_wl2/ecore_wl2_window.c

index 800c1ad..9ba9600 100644 (file)
@@ -99,6 +99,7 @@ struct _Ecore_Wl2_Window
    Eina_Bool focused : 1;
    Eina_Bool resizing : 1;
    Eina_Bool alpha : 1;
+   Eina_Bool transparent : 1;
 };
 
 struct _Ecore_Wl2_Output
index ed32719..bcd10d7 100644 (file)
@@ -268,6 +268,11 @@ ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x
    win->geometry.w = w;
    win->geometry.h = h;
 
+   win->opaque.x = x;
+   win->opaque.y = y;
+   win->opaque.w = w;
+   win->opaque.h = h;
+
    win->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
 
    display->windows =
@@ -520,6 +525,23 @@ ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha)
 }
 
 EAPI void
+ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if (window->transparent == transparent) return;
+
+   window->transparent = transparent;
+
+   if (!window->transparent)
+     ecore_wl2_window_opaque_region_set(window, window->opaque.x,
+                                        window->opaque.y, window->opaque.w,
+                                        window->opaque.h);
+   else
+     ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
+}
+
+EAPI void
 ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
 {
    struct wl_region *region;