e_client: Appy base output resolution to subsurfaces 55/285655/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 15 Dec 2022 06:19:16 +0000 (15:19 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 16 Dec 2022 05:01:36 +0000 (14:01 +0900)
This patch is to apply base output resolution of toplevel window to all
subsurfaces. So, it removes call to e_comp_wl_hook_del() and continue to
listen E_COMP_WL_HOOK_SUBSURFACE_CREATE hook point.

Some wayland clients repeatedly reuse wl_surface to create wl_subsurface
with a different parent from previous one. The problem is that the
subsurface can't get applied with base output resolution of a new
toplevel window in this case.

To apply base output resolution of a new parent to all associated
sub-surfaces, we should call e_client_transform_core_update() for a
toplevel window whenever a subsurface gets created with a new parent.

Since e_client_transform_core_update() recursively updates transform for
all sub-surfaces, calling e_client_transform_core_update() for a
toplevel window should also update transform for all subsurfaces.

Change-Id: I3253f83e0ab1cf1f5381bbfba2693d9d642d88ca

src/bin/e_client.c

index 8b9f66b9b4b3299419ca3ed0760263bbb9a70a4f..46c175da44c5d94b5021d558bdc23793bc182936 100644 (file)
@@ -7989,21 +7989,23 @@ e_client_image_save(E_Client *ec, const char *dir, const char *name, E_Capture_C
 }
 
 static void
-_e_client_base_output_resolution_hook_subsurf_create(void *data, E_Client *ec)
+_e_client_base_output_resolution_hook_subsurf_create(void *data, E_Client *subc)
 {
-   E_Client *parent;
+   E_Client *ec, *parent;
 
-   if (!ec->base_output_resolution.hook_subsurf_create)
+   ec = data;
+   if (ec != subc)
      return;
 
    ec->base_output_resolution.use = 0;
    ec->base_output_resolution.w = 0;
    ec->base_output_resolution.h = 0;
-   e_client_transform_core_remove(ec, ec->base_output_resolution.transform);
-   E_FREE_FUNC(ec->base_output_resolution.transform, e_util_transform_del);
-   E_FREE_FUNC(ec->base_output_resolution.hook_subsurf_create, e_comp_wl_hook_del);
-
-   ELOGF("POL_APPINFO", "Cancel TRANSFORM for subsurface", ec);
+   if (ec->base_output_resolution.transform)
+     {
+        e_client_transform_core_remove(ec, ec->base_output_resolution.transform);
+        E_FREE_FUNC(ec->base_output_resolution.transform, e_util_transform_del);
+        ELOGF("POL_APPINFO", "Cancel TRANSFORM for subsurface", ec);
+     }
 
    /* Update transform for toplevel surface.
     * The transform of subsurface will be updated by its parent accordingly. */
@@ -8033,7 +8035,7 @@ _e_client_base_output_resolution_set(E_Client *ec, int width, int height)
         ec->base_output_resolution.hook_subsurf_create =
            e_comp_wl_hook_add(E_COMP_WL_HOOK_SUBSURFACE_CREATE,
                               _e_client_base_output_resolution_hook_subsurf_create,
-                              NULL);
+                              ec);
      }
 }