e_comp_wl: Deprecate first_commit 26/325426/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 28 May 2025 10:40:34 +0000 (19:40 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 10 Jun 2025 09:08:58 +0000 (18:08 +0900)
The implementation related to the first_commit flag is moved to
E_Aux_Hint_Surface.

Change-Id: If2e447e013da3eca228a08d7dd4469e50ec53772

src/bin/server/e_compositor.c
src/bin/windowmgr/e_hints.c
src/bin/windowmgr/e_hints_intern.h
src/bin/windowmgr/e_policy_zone.c
src/include/e_comp_wl.h

index 98ce7c555ea13bedcaafc648eac60379b3552a20..b4780cedc4192fa271cd323a3af1f61ca681b312 100644 (file)
@@ -1384,9 +1384,6 @@ _e_surface_commit_pre(E_Surface *surface)
 {
    E_Client *ec = surface->ec;
 
-   if (!surface->base.first_commit)
-     surface->base.first_commit = EINA_TRUE;
-
    if (!surface->base.mapped)
      {
         if (surface->base.shell.surface && surface->base.pending.new_attach &&
index d556419fc972ee99733271d9d2a04dfd2dd3a9ad..4ed85f6e32a799001756676f41f1c5f75dd6c89b 100644 (file)
@@ -15,9 +15,11 @@ struct _E_Aux_Hint_Surface
    Eina_List *hints;
    bool changed;
    bool use_msg;
+   bool committed;
 
    struct wl_listener ec_destroy;
    struct wl_listener surface_destroy;
+   struct wl_listener commit;
 };
 
 static Eina_List *aux_hints_supported = NULL;
@@ -203,6 +205,9 @@ _surface_destroy(E_Aux_Hint_Surface *surface)
         E_FREE(hint);
      }
 
+   if (!surface->committed)
+     wl_list_remove(&surface->commit.link);
+
    if (surface->ec)
      wl_list_remove(&surface->ec_destroy.link);
 
@@ -227,6 +232,15 @@ _surface_cb_surface_destroy(struct wl_listener *listener, void *data)
    _surface_destroy(surface);
 }
 
+static void
+_surface_cb_commit(struct wl_listener *listener, void *data)
+{
+   E_Aux_Hint_Surface *surface = wl_container_of(listener, surface, commit);
+
+   surface->committed = true;
+   wl_list_remove(&surface->commit.link);
+}
+
 static E_Aux_Hint_Surface *
 _surface_create(E_Surface *e_surface)
 {
@@ -244,6 +258,9 @@ _surface_create(E_Surface *e_surface)
    surface->surface_destroy.notify = _surface_cb_surface_destroy;
    e_surface_destroy_listener_add(e_surface, &surface->surface_destroy);
 
+   surface->commit.notify = _surface_cb_commit;
+   e_surface_commit_listener_add(e_surface, &surface->commit);
+
    ELOGF("HINTS", "Create E_Aux_Hint_Surface(%p)", surface->ec, surface);
 
    return surface;
@@ -473,3 +490,9 @@ e_aux_hint_surface_use_msg_get(E_Aux_Hint_Surface *surface)
 {
    return surface->use_msg;
 }
+
+EINTERN bool
+e_aux_hint_surface_is_committed(E_Aux_Hint_Surface *surface)
+{
+   return surface->committed;
+}
index 8f2ca4e1c450c1af2c6fa58c3badf3c5a0e8a1d8..e73eef7c6022b848c017e380df0a4035acd9d8d3 100644 (file)
@@ -79,6 +79,11 @@ bool e_aux_hint_surface_is_changed(E_Aux_Hint_Surface *surface);
  */
 Eina_List *e_aux_hint_surface_hints_get(E_Aux_Hint_Surface *surface);
 
+/**
+ * Check if the associated surface has been committed
+ */
+bool e_aux_hint_surface_is_committed(E_Aux_Hint_Surface *surface);
+
 /**
  * Set use_msg to given value
  */
index 0ff1c77dcba5ccb18aba6095be9b4305064994cb..8f4640e4db5097d6ce53e42b096e696dc7b94676 100644 (file)
@@ -27,6 +27,7 @@
 #include "e_policy_wl_intern.h"
 #include "e_policy_container_intern.h"
 #include "e_view_rect.h"
+#include "e_hints_intern.h"
 
 #define ZONE_EC_DATA_KEY  "E_Zone_Client"
 
@@ -2216,9 +2217,9 @@ e_policy_zone_evaluate(E_Policy_Zone *policy_zone, Eina_Bool *check_focus)
              // ignored client but needing eval (aux hint) such as remote surfaces
               if (ec->changed)
                  {
-                    E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
-                    if (cdata && cdata->first_commit)
-                       e_client_aux_hint_eval(ec);
+                    E_Aux_Hint_Surface *hsurface = e_aux_hint_surface_try_from_ec(ec);
+                    if (hsurface && e_aux_hint_surface_is_committed(hsurface))
+                      e_client_aux_hint_eval(ec);
                  }
               continue;
            }
index fffdd39ea2a0af9d617900125f2fd2839b193d9e..ce7e5f7e5cb5f95afbe1d2e1b3cae6893ba5945f 100644 (file)
@@ -478,7 +478,7 @@ struct _E_Comp_Wl_Client_Data
    E_DEPRECATED Eina_Bool video_client : 1;
    Eina_Bool has_video_client : 1;
    E_DEPRECATED Eina_Bool never_hwc : 1;          //  force window not to do hwc
-   Eina_Bool first_commit : 1;       // TRUE : once client committed
+   E_DEPRECATED Eina_Bool first_commit : 1;       // TRUE : once client committed
    E_DEPRECATED unsigned char accepts_focus : 1;
    E_DEPRECATED unsigned char conformant : 1;
    E_DEPRECATED E_Window_Type win_type;