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 092d8c3c78e5fa47c3e436456e77758e857b6cf5
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Aug 18 19:17:04 2026 -0600

    wl_test - do not read the pointer position back while a motion is queued
    
    ecore_event_add queues; it does not dispatch. So between posting a motion
    and that motion reaching the canvas, evas still reports the position from
    before it - and the button request read exactly that, because reading the
    position back from E is the right answer when nothing is in flight.
    
    The result was a click at stale coordinates. Measured: wlcs
    grabbed_popups_get_done_events_in_correct_order stopped passing, because
    a click meant to land outside a grabbing popup landed inside it and the
    grab was never dismissed.
    
    So track what was last posted, and prefer that while it is still on its
    way. Once the motion has been fed to the canvas the tracked copy is
    dropped and E's own answer is used again, which is what makes a pointer
    constraint that moved the pointer somewhere of its own choosing still the
    authority on where it is.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
 src/modules/wl_test/e_mod_main.c | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/modules/wl_test/e_mod_main.c b/src/modules/wl_test/e_mod_main.c
index 3c6457d5b..3a1e9c0db 100644
--- a/src/modules/wl_test/e_mod_main.c
+++ b/src/modules/wl_test/e_mod_main.c
@@ -145,6 +145,32 @@ _wl_test_cb_zone_add(struct wl_client *client EINA_UNUSED, struct wl_resource *r
  * compares against - e_dnd's _drag_win, for one - and an event on any other
  * window is skipped by exactly the handlers this exists to reach.
  */
+/* Where we last told the pointer to be, and whether that has reached the
+ * canvas yet.
+ *
+ * Reading the position back from evas is the right answer when nothing is in
+ * flight - a pointer constraint may have moved the pointer somewhere of its
+ * own choosing, and E's copy is then the true one. It is the wrong answer
+ * while a motion we posted is still queued, because ecore_event_add does not
+ * dispatch: a button request arriving right after a warp would read the
+ * position from before the warp and act on it. That is not hypothetical - it
+ * put clicks inside a popup that were meant to land outside it, so the grab
+ * was never dismissed. */
+static int _posted_x, _posted_y;
+static Eina_Bool _posted_pending = EINA_FALSE;
+
+static void
+_pointer_xy_now(int *x, int *y)
+{
+   if (_posted_pending)
+     {
+        *x = _posted_x;
+        *y = _posted_y;
+        return;
+     }
+   _pointer_xy_get(x, y);
+}
+
 static unsigned int
 _input_timestamp(void)
 {
@@ -175,6 +201,10 @@ _pointer_ecore_move(int x, int y)
    ev->multi.radius_y = 1;
    ev->multi.pressure = 1.0;
 
+   _posted_x = x;
+   _posted_y = y;
+   _posted_pending = EINA_TRUE;
+
    ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
 }
 
@@ -226,9 +256,9 @@ _wl_test_cb_pointer_button(struct wl_client *client EINA_UNUSED, struct wl_resou
      }
 
    {
-      Evas_Coord px, py;
+      int px, py;
 
-      evas_pointer_canvas_xy_get(e_comp->evas, &px, &py);
+      _pointer_xy_now(&px, &py);
       _pointer_ecore_button(b, pressed, px, py);
    }
 }
@@ -359,6 +389,7 @@ _input_cb_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
    Ecore_Event_Mouse_Move *ev = event;
 
    if (ev->window != e_comp->ee_win) return ECORE_CALLBACK_RENEW;
+   _posted_pending = EINA_FALSE;
    evas_event_feed_mouse_move(e_comp->evas, ev->x, ev->y, ev->timestamp, NULL);
    return ECORE_CALLBACK_RENEW;
 }

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

Reply via email to