e_hwc_windows: attach null buffer after e_comp_object_redirected_set 07/239807/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 30 Jul 2020 04:43:46 +0000 (13:43 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 4 Aug 2020 02:22:34 +0000 (11:22 +0900)
e_comp_object_redireceted_set should be called after buffer is attached to surface,
because evas_map of screen rotation is applied when e_comp_object_redirected_set.

Change-Id: I8073079f0f98c660a02c98361888b973466608cf

src/bin/e_hwc_window.c

index a26a9bddefcc7d13d7b1479cdeecfbf5e7ea6021..5d6d7cc0075612c7cabd5584f3bdd76cca64a2e3 100644 (file)
@@ -1912,7 +1912,7 @@ e_hwc_window_constraints_update(E_Hwc_Window *hwc_window)
 }
 
 static Eina_Bool
-_e_hwc_window_client_recover(E_Hwc_Window *hwc_window)
+_e_hwc_window_client_recover(E_Hwc_Window *hwc_window, Eina_Bool *clear_attach)
 {
    E_Comp_Wl_Buffer *recover_buffer = NULL;;
    E_Comp_Wl_Buffer *comp_wl_buffer;
@@ -1969,8 +1969,13 @@ _e_hwc_window_client_recover(E_Hwc_Window *hwc_window)
         e_comp_object_render(ec->frame);
      }
 
-   if (!comp_wl_buffer && ec->comp_data)
-     e_comp_wl_surface_attach(ec, NULL);
+   if (clear_attach)
+     {
+        if (!comp_wl_buffer)
+          *clear_attach = EINA_TRUE;
+        else
+          *clear_attach = EINA_FALSE;
+     }
 
    return EINA_TRUE;
 }
@@ -1980,6 +1985,7 @@ _e_hwc_window_rendered_window_set(E_Hwc_Window *hwc_window, Eina_Bool set)
 {
    E_Client *ec = NULL;
    Eina_Bool ret;
+   Eina_Bool clear_attach = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
 
@@ -1992,7 +1998,7 @@ _e_hwc_window_rendered_window_set(E_Hwc_Window *hwc_window, Eina_Bool set)
 
    if (set)
      {
-        ret = _e_hwc_window_client_recover(hwc_window);
+        ret = _e_hwc_window_client_recover(hwc_window, &clear_attach);
 
         if (hwc_window->ec->redirected)
           {
@@ -2004,6 +2010,9 @@ _e_hwc_window_rendered_window_set(E_Hwc_Window *hwc_window, Eina_Bool set)
              EHWTRACE("Redirect -- {%s}",
                       hwc_window->ec, hwc_window->hwc, hwc_window, e_hwc_window_name_get(hwc_window));
           }
+
+        if (clear_attach && ec->comp_data)
+          e_comp_wl_surface_attach(ec, NULL);
      }
    else
      {