devilhorns pushed a commit to branch master.

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

commit 559490d7568bac10a9cfe2449ec4af29d8d6cfc0
Author: Chris Michael <[email protected]>
Date:   Tue Feb 14 09:58:49 2017 -0500

    ecore-wl2: Fix setting opaque region on a window
    
    Previous code here would store incorrect values into the
    window->opaque rectangle. These values should be what is actually
    getting set in the wl_region. This code also fixes an issue when
    setting opaque region for transparent/alpha windows by clearing out
    any pending opaque region (wl_surface_set_opaque_region(surface, null)).
    
    Reviewed-By: Derek Foreman <[email protected]>
    
    @fix
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wl2/ecore_wl2_window.c | 58 ++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 22 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index fb75bf5..d087014 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -880,42 +880,56 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window 
*window, int x, int y, int w
 
    EINA_SAFETY_ON_NULL_RETURN(window);
 
-   if ((window->opaque.x == x) && (window->opaque.y == y) &&
-       (window->opaque.w == w) && (window->opaque.h == h))
-     return;
-
-   window->opaque.x = x;
-   window->opaque.y = y;
-   window->opaque.w = w;
-   window->opaque.h = h;
-   window->opaque_set = 1;
-
-   if ((window->transparent) || (window->alpha)) return;
-   if (!window->surface) return; //surface not created yet
-
-   region = wl_compositor_create_region(window->display->wl.compositor);
-   if (!region)
+   if ((x == 0) && (y == 0) && (w == 0) && (h == 0))
      {
-        ERR("Failed to create opaque region");
+        if (window->surface)
+          wl_surface_set_opaque_region(window->surface, NULL);
         return;
      }
 
    switch (window->rotation)
      {
       case 0:
-        wl_region_add(region, x, y, w, h);
-        break;
-      case 180:
-        wl_region_add(region, x, x + y, w, h);
+        window->opaque.x = x;
+        window->opaque.y = y;
+        window->opaque.w = w;
+        window->opaque.h = h;
         break;
       case 90:
-        wl_region_add(region, y, x, h, w);
+        window->opaque.x = y;
+        window->opaque.y = x;
+        window->opaque.w = h;
+        window->opaque.h = w;
+        break;
+      case 180:
+        window->opaque.x = x;
+        window->opaque.y = x + y;
+        window->opaque.w = w;
+        window->opaque.h = h;
         break;
       case 270:
-        wl_region_add(region, x + y, x, h, w);
+        window->opaque.x = x + y;
+        window->opaque.y = x;
+        window->opaque.w = h;
+        window->opaque.h = w;
+        break;
+      default:
         break;
      }
 
+   window->opaque_set = EINA_TRUE;
+
+   if (!window->surface) return;
+
+   region = wl_compositor_create_region(window->display->wl.compositor);
+   if (!region)
+     {
+        ERR("Failed to create opaque region");
+        return;
+     }
+
+   wl_region_add(region, window->opaque.x, window->opaque.y,
+                 window->opaque.w, window->opaque.h);
    wl_surface_set_opaque_region(window->surface, region);
    wl_region_destroy(region);
 }

-- 


Reply via email to