This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch wl/browser-all
in repository enlightenment.

View the commit online.

commit 94691a90d5e4e81c8139a8c2e883d94cf9ab67be
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Aug 11 08:37:42 2026 -0600

    e_comp_wl - end a touch when the surface under it is destroyed
    
    A client that destroyed a surface with a finger still down on it was
    never told the touch had ended. Its seat went on holding a gesture
    against a surface that no longer exists, and nothing it did afterwards
    could clear it - the up it was waiting for could only ever have come
    from us.
    
    This is the same hole e4be54e58 closed for the pointer, on the other
    half of the seat. The touch points recorded for the re-report work are
    what makes it fixable now: they say which fingers are down and on whom.
    
    Send the up from where we already drop the pointer focus, before the
    surface stops being nameable, since the surface resource is what says
    which client's wl_touch objects the event belongs on. The client-del
    path keeps working the way it did: by then the surface can already be
    gone, and with nobody left to tell, freeing the points is all there is
    to do.
    
    wlcs: 696 passed -> 701. Fixes sends_touch_up_on_surface_destroy for all
    six surface types, no regressions.
---
 src/bin/e_comp_wl.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 1a635c55b..4846dbe76 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -568,16 +568,46 @@ _e_comp_wl_touch_point_del(int device)
 }
 
 /* A client can go away with fingers still on it - the points would then name
- * freed memory. */
+ * freed memory. End them properly on the way out: a touch that is never
+ * released is a gesture the client thinks is still running, on a surface that
+ * no longer exists.
+ *
+ * Sending needs the surface resource, because that is what names the client
+ * whose wl_touch objects the up belongs on. By the time the client is being
+ * deleted the surface may already be gone; then there is nobody left to tell
+ * and freeing the points is all that is left to do. */
 static void
 _e_comp_wl_touch_points_drop(E_Client *ec)
 {
    E_Comp_Wl_Touch_Point *tp;
    Eina_List *l, *ll;
+   struct wl_client *wc = NULL;
+
+   if (ec->comp_data && ec->comp_data->surface)
+     wc = wl_resource_get_client(ec->comp_data->surface);
 
    EINA_LIST_FOREACH_SAFE(e_comp_wl->touch.points, l, ll, tp)
      {
         if (tp->ec != ec) continue;
+
+        if (wc)
+          {
+             struct wl_resource *res;
+             Eina_List *rl;
+             uint32_t serial;
+
+             serial = wl_display_next_serial(e_comp_wl->wl.disp);
+             EINA_LIST_FOREACH(e_comp_wl->touch.resources, rl, res)
+               {
+                  if (wl_resource_get_client(res) != wc) continue;
+                  if (!e_comp_wl_input_touch_check(res)) continue;
+                  wl_touch_send_up(res, serial,
+                                   (unsigned int)lround(ecore_loop_time_get() * 1000),
+                                   tp->device);
+                  wl_touch_send_frame(res);
+               }
+          }
+
         e_comp_wl->touch.points = eina_list_remove_list(e_comp_wl->touch.points, l);
         free(tp);
      }
@@ -1932,8 +1962,12 @@ _e_comp_wl_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_re
      {
         /* Before the surface stops being nameable: a client destroying the
          * surface under the pointer still has to leave it, or the seat keeps
-         * a stale focus and denies the enter to whatever is underneath. */
+         * a stale focus and denies the enter to whatever is underneath. The
+         * same goes for a finger still down on it - the up has to go out
+         * while there is still a surface resource to say which client it
+         * belongs to. */
         e_comp_wl_pointer_focus_drop(ec);
+        _e_comp_wl_touch_points_drop(ec);
         ec->comp_data->surface = NULL;
      }
    wl_resource_destroy(resource);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to