ecore_wl2: Fix setting empty opaque regions
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 5 Oct 2017 19:56:58 +0000 (14:56 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 12 Oct 2017 17:24:03 +0000 (12:24 -0500)
We should still update window->opaque when the opaque region is empty.

src/lib/ecore_wl2/ecore_wl2_window.c

index ebb7918..6ee4b39 100644 (file)
@@ -711,13 +711,6 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
 
    EINA_SAFETY_ON_NULL_RETURN(window);
 
-   if ((x == 0) && (y == 0) && (w == 0) && (h == 0))
-     {
-        if (window->surface)
-          wl_surface_set_opaque_region(window->surface, NULL);
-        return;
-     }
-
    switch (window->rotation)
      {
       case 0:
@@ -756,10 +749,16 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
    window->opaque.y = ny;
    window->opaque.w = nw;
    window->opaque.h = nh;
-   window->opaque_set = EINA_TRUE;
+   window->opaque_set = x || y || w || h;
 
    if (!window->surface) return;
 
+   if (!window->opaque_set)
+     {
+        wl_surface_set_opaque_region(window->surface, NULL);
+        return;
+     }
+
    region = wl_compositor_create_region(window->display->wl.compositor);
    if (!region)
      {