e_comp_wl: Deprecate frames of E_Comp_Wl_Surface_State
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 22 Aug 2024 09:28:43 +0000 (18:28 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Thu, 29 Aug 2024 06:50:58 +0000 (15:50 +0900)
src/bin/server/e_comp_wl.c
src/bin/server/e_comp_wl_rsm.c
src/bin/server/e_compositor.c
src/include/e_comp_wl.h

index 651558048880f185b82847aad625d601339a171c..0dd0cde23adef3f465dbd3436eb51cdf3ec809b1 100644 (file)
@@ -2570,11 +2570,6 @@ _e_comp_wl_surface_state_init(E_Comp_Wl_Surface_State *state, int w, int h)
 static void
 _e_comp_wl_surface_state_finish(E_Comp_Wl_Surface_State *state)
 {
-   struct wl_resource *cb;
-
-   EINA_LIST_FREE(state->frames, cb)
-     wl_resource_destroy(cb);
-
    if (state->buffer) wl_list_remove(&state->buffer_destroy_listener.link);
    state->buffer = NULL;
 
@@ -3054,14 +3049,6 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
    state->sy = 0;
    state->new_attach = EINA_FALSE;
 
-   e_surface_frame_done_send(surface);
-
-   /* insert state frame callbacks into comp_data->frames
-    * NB: This clears state->frames list */
-   cdata->frames = eina_list_merge(cdata->frames,
-                                           state->frames);
-   state->frames = NULL;
-
    if (e_client_view_get(ec))
      _e_comp_wl_surface_damage_update(ec);
 
index 7a7d90c53895e4306f9b8f085840e666da58f9f2..f36c0b8a68929ee06301b41d946efa38ba94e358 100644 (file)
@@ -3037,12 +3037,6 @@ _e_comp_wl_remote_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *st
    state->sy = 0;
    state->new_attach = EINA_FALSE;
 
-   e_surface_frame_done_send(e_surface_from_ec(ec));
-
-   ec->comp_data->frames = eina_list_merge(ec->comp_data->frames,
-                                           state->frames);
-   state->frames = NULL;
-
    state->buffer_viewport.changed = 0;
 
    wl_signal_emit(&cdata->state_commit_signal, &cdata->surface);
index 50fe9ab116e119078c6eda40d8cffbdd3ea602f2..2a54d7281b1e0450901843d082c36694474cc32c 100644 (file)
@@ -1065,28 +1065,16 @@ _frame_callback_cb_destroy(struct wl_listener *listener, void *data)
 {
    struct wl_resource *resource = data;
    E_Frame_Callback *frame_callback;
-   E_Surface *surface;
-   E_Subsurface *subsurface;
 
    frame_callback = wl_container_of(listener, frame_callback, destroy);
-   surface = frame_callback->surface;
-
-   if (surface->base.frames)
-     surface->base.frames = eina_list_remove(surface->base.frames, resource);
-
-   if (surface->base.pending.frames)
-     surface->base.pending.frames = eina_list_remove(surface->base.pending.frames, resource);
-
-   subsurface = _e_subsurface_try_from_surface(surface);
-   if (subsurface && subsurface->base.cached.frames)
-     subsurface->base.cached.frames = eina_list_remove(subsurface->base.cached.frames, resource);
 
+   frame_callback->surface->base.frames = eina_list_remove(frame_callback->surface->base.frames, resource);
    wl_list_remove(&frame_callback->destroy.link);
    free(frame_callback);
 }
 
 static Eina_Bool
-_e_surface_pending_frame_callback_add(E_Surface *surface, struct wl_resource *resource)
+_e_surface_frame_callback_add(E_Surface *surface, struct wl_resource *resource)
 {
    E_Frame_Callback *frame_callback;
 
@@ -1099,20 +1087,25 @@ _e_surface_pending_frame_callback_add(E_Surface *surface, struct wl_resource *re
    frame_callback->destroy.notify = _frame_callback_cb_destroy;
    wl_resource_add_destroy_listener(resource, &frame_callback->destroy);
 
-   surface->base.pending.frames = eina_list_prepend(surface->base.pending.frames, resource);
+   surface->base.frames = eina_list_prepend(surface->base.frames, resource);
 
    return EINA_TRUE;
 }
 
 static void
-_e_surface_pending_frame_callback_update(E_Surface *surface)
+_e_surface_frame_callback_list_update(E_Surface *surface)
 {
    struct ds_surface *ds_surface = surface->ds_surface;
    struct wl_resource *resource, *tmp;
 
+   // FIXME
+   // flush frame callback events to fix the problem that some application
+   // historically had without this.
+   e_surface_frame_done_send(surface);
+
    wl_resource_for_each_safe(resource, tmp, &ds_surface->current.frame_callback_list)
      {
-        if (_e_surface_pending_frame_callback_add(surface, resource))
+        if (_e_surface_frame_callback_add(surface, resource))
           {
              wl_list_remove(wl_resource_get_link(resource));
              wl_list_init(wl_resource_get_link(resource));
@@ -1218,7 +1211,7 @@ _e_surface_pending_update(E_Surface *surface)
      _e_surface_pending_buffer_scale_update(surface);
 
    if (ds_surface->current.committed & DS_SURFACE_STATE_FRAME_CALLBACK_LIST)
-     _e_surface_pending_frame_callback_update(surface);
+     _e_surface_frame_callback_list_update(surface);
 
    if (ds_surface->current.committed & DS_SURFACE_STATE_VIEWPORT)
      _e_surface_pending_viewport_update(surface);
index af837158dba6b155c966654d53e1d3032e2997cf..94a2f8f1f46033eb7366dedb95d47392f26fd04b 100644 (file)
@@ -180,7 +180,7 @@ struct _E_Comp_Wl_Surface_State
    E_Comp_Wl_Buffer *buffer;
    struct wl_listener buffer_destroy_listener;
    EINA_DEPRECATED Eina_List *damages, *buffer_damages;
-   Eina_List *frames;
+   EINA_DEPRECATED Eina_List *frames;
    EINA_DEPRECATED Eina_Tiler *input;
    EINA_DEPRECATED Eina_Tiler *opaque;
    E_Comp_Wl_Buffer_Viewport buffer_viewport;