fix efl_util_set_window_opaque_state behavior 60/45560/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150809.064314 accepted/tizen/tv/20150809.064324 accepted/tizen/wearable/20150809.064338 submit/tizen/20150807.102244 submit/tizen/20150808.055555 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release
authorBoram Park <boram1288.park@samsung.com>
Fri, 7 Aug 2015 09:39:48 +0000 (18:39 +0900)
committerBoram Park <boram1288.park@samsung.com>
Fri, 7 Aug 2015 09:40:30 +0000 (18:40 +0900)
Change-Id: I9936753c5b02698de2011ff106b4cb6acad16c4e

src/efl_util.c

index bbf8e9d..a65ab0c 100644 (file)
@@ -877,25 +877,32 @@ efl_util_set_window_opaque_state(Evas_Object *window,
 
 #if WAYLAND
    Ecore_Wl_Window *wlwin;
-   int x, y, w, h;
-
-   res = _wl_init();
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   struct wl_surface *surface;
 
-   wlwin = elm_win_wl_window_get(window);
-   if (wlwin)
+   if (!_eflutil.wl.policy.proto)
      {
-        evas_object_geometry_get(window, &x, &y, &w, &h);
+        int ret = 0;
 
-        if (opaque)
-          ecore_wl_window_opaque_region_set(wlwin, x, y, w, h);
-        else
-          ecore_wl_window_opaque_region_set(wlwin, 0, 0, 0, 0);
+        res = _wl_init();
+        EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-        return EFL_UTIL_ERROR_NONE;
+        while (!_eflutil.wl.policy.proto && ret != -1)
+          ret = wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+        EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.policy.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
      }
 
-   return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
+   wlwin = elm_win_wl_window_get(window);
+   if (!wlwin)
+      return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
+
+   surface  = ecore_wl_window_surface_get(wlwin);
+   if (!surface)
+      return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
+
+   tizen_policy_set_opaque_state(_eflutil.wl.policy.proto, surface, opaque);
+
+   return EFL_UTIL_ERROR_NONE;
 #endif /* end of WAYLAND */
 }