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 cbc9ae50bb858d6e8568e654252a7e99d5cd0bb6
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Aug 18 20:39:36 2026 -0600

    e_comp_wl - hand the pointer back when a move ends without one
    
    xdg-shell hedges - "there is no guarantee that the device focus will
    return when the move is completed" - and E had already chosen to return
    it, because as far as the user is concerned the cursor never left the
    window. The code to do it only worked when something moved.
    
    _e_comp_wl_pointer_focus_reeval() hands evas a motion at the position the
    pointer is already at, and evas answers with a mouse-in only when the
    object under the pointer has changed. It has not: the leave was sent at
    the wayland level, and evas never stopped believing the pointer was
    inside the frame. So a drag that ends with the pointer where it started
    left the client believing the pointer was elsewhere - no hover, no cursor
    of its own - until the user happened to move the mouse again.
    
    Every wlcs interactive-move test that passes does so because it moves the
    pointer once more at the end; touch_can_not_steal_pointer_based_move does
    not, and failed on window_under_cursor() being NULL rather than on
    anything to do with touch. E was already right about the thing that test
    is named for: the window did not move.
    
    This can only ever repair a missing enter, never add one. The first
    version fired on any move whose end left ptr.ec pointing elsewhere, and
    that regressed browser-firefox twice running - a programmatic move to
    another screen is a MOVE_END too, and injecting an enter into one changed
    what the browser did next. Checking E's idea of the focused client is not
    enough: it can name this client while its pointer resources have already
    been left, and the reverse. So the test is on the resources themselves -
    if any is still marked entered, there is nothing to give back and an
    enter here would be the duplicate the protocol forbids.
    
    wlcs: 38 of 39 across the XdgToplevel, ClientSurfaceEvents and
    SurfacePointerMotion families, up from 37, with all three browser tests
    green. The one left is XdgToplevelV6Test.surface_can_be_moved_
    interactively, recorded here as an expected failure: it waits for a
    wl_pointer button release after xdg_toplevel.move, which cannot come once
    the surface has lost device focus, and its own stable twin does not ask
    for it.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
 src/bin/e_comp_wl.c                  | 53 ++++++++++++++++++++++++++++++++++++
 src/tests/wlcs/expected-failures.txt |  2 ++
 2 files changed, 55 insertions(+)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index f50b7f0ef..89673dae3 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -3994,6 +3994,59 @@ _e_comp_wl_client_cb_move_end(void *data EINA_UNUSED, E_Client *ec)
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (e_client_has_xwindow(ec)) return;
    _e_comp_wl_pointer_focus_reeval();
+
+   /* The re-evaluation above only works if something moved.
+    *
+    * It hands evas a motion at the position the pointer is already at, and
+    * evas answers with a mouse-in only when the object under the pointer has
+    * changed. It has not: the leave that started the move was sent at the
+    * *wayland* level by e_comp_wl_pointer_focus_drop, and evas never stopped
+    * believing the pointer was inside the frame. So a drag that ends without
+    * the pointer moving afterwards left the client thinking the pointer was
+    * somewhere else entirely - no hover, no cursor of its own - until the user
+    * happened to move the mouse again.
+    *
+    * Every wlcs interactive-move test that passes does so because it moves the
+    * pointer once more at the end; the one that does not, does not.
+    *
+    * Sending the enter directly is safe against the double-enter this looks
+    * like: _e_comp_wl_mouse_in skips any pointer resource already marked
+    * entered, which is the same guard that keeps the ordinary path honest. */
+   if (e_comp_wl->drag) return;
+   {
+      Evas_Event_Mouse_In ev;
+      Evas_Coord x, y;
+      struct wl_resource *res;
+      struct wl_client *wc;
+      Eina_List *l;
+
+      if (!ec->comp_data->surface) return;
+
+      /* Only ever repair a missing enter, never add one.
+       *
+       * Any pointer resource of this client still marked entered means it was
+       * never told to leave, so there is nothing to give back and an enter
+       * here would be the duplicate the protocol forbids. Checking E's idea of
+       * the focused client instead is not enough - it can name this client
+       * while the resources have already been left, and the reverse. */
+      wc = wl_resource_get_client(ec->comp_data->surface);
+      EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
+        {
+           E_Comp_Wl_Pointer *ptr = wl_resource_get_user_data(res);
+
+           if (!e_comp_wl_input_pointer_check(res)) continue;
+           if (wl_resource_get_client(res) != wc) continue;
+           if (ptr->entered) return;
+        }
+
+      evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
+      if (!E_INSIDE(x, y, ec->x, ec->y, ec->w, ec->h)) return;
+
+      memset(&ev, 0, sizeof(ev));
+      ev.canvas.x = x;
+      ev.canvas.y = y;
+      _e_comp_wl_mouse_in(ec, &ev);
+   }
 }
 
 static void
diff --git a/src/tests/wlcs/expected-failures.txt b/src/tests/wlcs/expected-failures.txt
index 72d5c9c97..b474c1a34 100644
--- a/src/tests/wlcs/expected-failures.txt
+++ b/src/tests/wlcs/expected-failures.txt
@@ -12,3 +12,5 @@
 # holds, and delete the line rather than the check when it stops holding.
 
 BadBufferTest.client_lies_about_buffer_size  libwayland wl_shm accepts a stride too small for the format; see libwayland-shm-stride-bug.md. E rejects the buffer at attach so the out-of-bounds read is closed, but the test asserts the error on wl_shm_pool from create_buffer, which is libwayland's request and not ours. Remove when libwayland validates stride against bytes-per-pixel.
+
+XdgToplevelV6Test.surface_can_be_moved_interactively  Asserts more than xdg-shell requires. After xdg_toplevel.move the test waits for the wl_pointer button *release*, but the protocol says "if triggered, the surface will lose the focus of the device used for the move" and "there is no guarantee that the device focus will return" - so a compositor that sends the leave, as E does, can never deliver that release. The stable twin of this same test does not make the assertion, which is the t [...]

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

Reply via email to