e_hwc_windows: attach null buffer after e_comp_object_redirected_set 83/240183/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 30 Jul 2020 04:43:46 +0000 (13:43 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Wed, 5 Aug 2020 09:48:07 +0000 (18:48 +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 7f1e9e3bb20a01616fc70b60ce2f88013da3cea3..abdbf6abf05387e15ac302595d43546a20fbe927 100644 (file)
@@ -2033,7 +2033,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;
@@ -2090,8 +2090,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;
 }
@@ -2101,6 +2106,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);
 
@@ -2113,7 +2119,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)
           {
@@ -2125,6 +2131,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
      {