ecore_wl2: unset pending.opaque flag after calling wl_surface_set_opaque_region 43/248143/2
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 23 Nov 2020 03:53:40 +0000 (12:53 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 23 Nov 2020 04:44:59 +0000 (13:44 +0900)
There was a bug that the wl_surface_set_opaque_region was called twice.
In _opaque_set, wl_surface_set_opaque_region was called immediately.
But window's pending.opaque flag was not unset. So, wl_surface_set_opaque_region
called again by ecore_wl2_window_commit.

@tizen_fix

Change-Id: Iea688ed8793db6237c8ab68574936c8111638c2d

src/lib/ecore_wl2/ecore_wl2_window.c

index b9212ec..75fec92 100644 (file)
@@ -17,6 +17,10 @@ static Eina_Hash *_windows = NULL;
 static void _opaque_set(Ecore_Wl2_Window *window);
 //
 
+// TIZEN_ONLY(20201123)
+static void _opaque_region_set(Ecore_Wl2_Window *window, struct wl_region *region);
+//
+
 /* internal functions */
 void
 _ecore_wl2_window_init(void)
@@ -1662,7 +1666,7 @@ ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha)
 //
      }
    else if (window->surface)
-     wl_surface_set_opaque_region(window->surface, NULL);
+     _opaque_region_set(window, NULL);
 //
 }
 
@@ -1691,7 +1695,7 @@ ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent
      ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
 */
    else if (window->surface)
-     wl_surface_set_opaque_region(window->surface, NULL);
+     _opaque_region_set(window, NULL);
 //
 }
 
@@ -3209,7 +3213,12 @@ _regions_set(Ecore_Wl2_Window *window)
                                      window->opaque.w, window->opaque.h);
              if (!region) return;
           }
+        // TIZEN_ONLY(20201123)
+        /*
         wl_surface_set_opaque_region(window->surface, region);
+        */
+        _opaque_region_set(window, region);
+        //
      }
 
    if (!window->pending.input) goto out;
@@ -3241,6 +3250,19 @@ out:
    if (region) wl_region_destroy(region);
 }
 
+// TIZEN_ONLY(20201123)
+static void
+_opaque_region_set(Ecore_Wl2_Window *window, struct wl_region *region)
+{
+   if (!window) return;
+   if (!window->surface) return;
+
+   wl_surface_set_opaque_region(window->surface, region);
+
+   window->pending.opaque = EINA_FALSE;
+}
+//
+
 // TIZEN_ONLY(20190910)
 static void
 _opaque_set(Ecore_Wl2_Window *window)
@@ -3250,7 +3272,7 @@ _opaque_set(Ecore_Wl2_Window *window)
    if (!window->opaque_set)
      {
         if (window->surface)
-          wl_surface_set_opaque_region(window->surface, NULL);
+          _opaque_region_set(window, NULL);
         return;
      }
 
@@ -3263,7 +3285,7 @@ _opaque_set(Ecore_Wl2_Window *window)
 
    wl_region_add(region, window->opaque.x, window->opaque.y,
                  window->opaque.w, window->opaque.h);
-   wl_surface_set_opaque_region(window->surface, region);
+   _opaque_region_set(window, region);
    wl_region_destroy(region);
 }
 //