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 8e3715062c2e878e83bd90bc2713d947b3faa2c4
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Aug 9 15:45:49 2026 -0600

    e_comp_wl - stop gating touch on where the mouse is
    
    All three wl_touch handlers began
    
        if (!ec->mouse.in) return;
    
    so a finger on a surface the cursor did not happen to be over was thrown
    away. On a device with no mouse nothing ever sets mouse.in, which means E
    has never delivered touch to a Wayland client on a tablet or a touchscreen
    at all. That is the part worth caring about; the conformance number is a
    side effect.
    
    Nothing is lost by removing it. These callbacks hang off the client's frame
    object, so evas has already decided the touch landed on this client, and
    the wl_surface input region is enforced in that same hit test - E builds
    the region out of real evas rectangles in e_comp_object_input_area_set()
    with the buffer object passing events through, so a touch outside the
    region never reaches the handler. Regions keep working without touching
    region code.
    
    The up path was the worst of the three: a finger that slides off the
    surface still belongs to the surface it went down on, so the up has to be
    delivered precisely when the touch point is no longer inside.
    
    Measured with the coordinate fix from the previous commit in place, so the
    two are separable - AllSurfaceTypes/TouchTest, gate restored vs removed:
    
        6 passed 18 failed   ->   18 passed 6 failed
    
    Neither change does anything on its own. The whole input/subsurface block
    goes 337 passed 209 failed -> 445 passed 101 failed, and every one of the
    72 RegionSurfaceInputCombinations failures is gone - those were the touch
    half of a pointer/touch cross product, not a region bug.
    
    The in-tree test grew the case that would have caught this. What it had
    touched a surface the pointer was already sitting on, which is exactly the
    case that keeps working with the gate in place. It now parks the pointer
    well away first and touches anyway.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
 src/bin/e_comp_wl.c                    | 22 +++++++++++++++++++---
 src/tests/wayland/test_pointer_frame.c | 30 ++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 93c800d58..2d1aa9926 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -539,7 +539,18 @@ _e_comp_wl_evas_cb_multi_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
 
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (!ec->comp_data->surface) return;
-   if (!ec->mouse.in) return;
+
+   /* Deliberately not gated on ec->mouse.in. Touch is not the mouse: a finger
+    * on a surface the cursor happens not to be over is still a touch on that
+    * surface, and on a device with no mouse at all nothing ever sets mouse.in,
+    * so the gate silently discarded every touch event E had.
+    *
+    * Nothing is lost by dropping it. This callback is attached to the client's
+    * frame, so Evas has already decided the touch landed here, and the
+    * wl_surface input region is enforced in that same hit test - E builds it
+    * out of real evas rectangles (e_comp_object_input_area_set) with the
+    * buffer object passing events through, so a touch outside the region never
+    * reaches this function in the first place. */
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
@@ -569,7 +580,11 @@ _e_comp_wl_evas_cb_multi_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
 
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (!ec->comp_data->surface) return;
-   if (!ec->mouse.in) return;
+
+   /* No mouse.in gate; see _e_comp_wl_evas_cb_multi_down. Worse here than
+    * there, in fact: a finger that slides off the surface still belongs to the
+    * surface it went down on, so the up must be delivered even when the touch
+    * point has left. */
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
@@ -595,7 +610,8 @@ _e_comp_wl_evas_cb_multi_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
 
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (!ec->comp_data->surface) return;
-   if (!ec->mouse.in) return;
+
+   /* No mouse.in gate; see _e_comp_wl_evas_cb_multi_down. */
 
    wc = wl_resource_get_client(ec->comp_data->surface);
 
diff --git a/src/tests/wayland/test_pointer_frame.c b/src/tests/wayland/test_pointer_frame.c
index 1b5667395..1b0cbee95 100644
--- a/src/tests/wayland/test_pointer_frame.c
+++ b/src/tests/wayland/test_pointer_frame.c
@@ -451,6 +451,7 @@ main(void)
      { _log_dump(); FAIL("a touch motion was left unterminated by a wl_touch.frame"); }
    printf("test-pointer-frame: touch is framed\n");
 
+
    /* Leave. The pointer is moved right off the surface. */
    _log_reset();
    wl_test_pointer_warp(tester, 5, 5);
@@ -462,5 +463,34 @@ main(void)
      { _log_dump(); FAIL("a leave was left unterminated by a frame"); }
    printf("test-pointer-frame: leave is framed\n");
 
+   /* Touch with the pointer somewhere else entirely.
+    *
+    * Everything above touched a surface the pointer was already sitting on,
+    * which is exactly the case that kept working while touch was in fact
+    * gated on ec->mouse.in - the mouse happened to be in. A tablet has no
+    * mouse to be anywhere, and 156 of the conformance suite's failures were
+    * this one line. The leave phase above has already parked the pointer at
+    * (5,5) and off the surface, so touch from here and expect delivery. */
+   _log_reset();
+   wl_test_touch_down(tester, 1, SX + (W / 2), SY + (H / 2));
+   if (tester_sync() < 0) FAIL("sync failed after off-pointer touch down");
+   wl_test_touch_up(tester, 1);
+   if (tester_sync() < 0) FAIL("sync failed after off-pointer touch up");
+   if (wl_display_roundtrip(disp) < 0) FAIL("roundtrip after off-pointer touch failed");
+
+   if (!_seen(EV_TOUCH_DOWN))
+     {
+        _log_dump();
+        FAIL("no wl_touch.down for a touch at (%d,%d), inside the surface at "
+             "(%d,%d) %dx%d, while the pointer sits at (5,5). Touch is not the "
+             "mouse: this must be delivered",
+             SX + W / 2, SY + H / 2, SX, SY, W, H);
+     }
+   if (!_closed_by(EV_TOUCH_DOWN, EV_TOUCH_FRAME))
+     { _log_dump(); FAIL("off-pointer touch down not framed"); }
+   if (!_seen(EV_TOUCH_UP))
+     { _log_dump(); FAIL("no wl_touch.up for the off-pointer touch"); }
+   printf("test-pointer-frame: touch works with the pointer elsewhere\n");
+
    return 0;
 }

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

Reply via email to