This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository enlightenment.
View the commit online.
commit ef670c15469434c6176973d5a092508c9e458839
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Nov 17 22:59:12 2026 -0600
e_comp_wl - no pointer enter or leave for a window being moved
wl-pointer-focus failed about once in fifteen parallel runs, with
"the grab did not take the pointer focus (2 leaves)". The client was
sent leave, enter, leave for one xdg_toplevel.move, with the pointer
still.
The move grabber is made a smart member of the frame of the client
being moved, so while it is up evas has the pointer in that frame
wherever it is. Showing it makes evas send the client a mouse-out and
then a mouse-in. Usually that happens at the next render, after
e_comp_wl_pointer_focus_drop() has sent the leave: the mouse-in then
goes out as a wl_pointer.enter in the middle of the grab. The test
missed it because that enter stood in for the one owed when the grab
ends. Now and then evas re-checks at once, inside the show, which is
before action_client is set: the client gets an extra leave and enter
before the grab's own leave.
The guard meant to refuse the mouse-out also needs a grabbed mouse
window, and under Wayland E grabs none here, so it never fires, and
nothing refused the mouse-in. Ignore both for a client that is moving.
ec->moving is set before the grabber is shown and cleared before
E_CLIENT_HOOK_MOVE_END, so the focus is still given back at the end.
The test now also checks that nothing enters during the grab. Without
the fix it fails 12 runs in 15; with it, 0 of 40 parallel full-suite
runs fail, and wlcs 1.8.1 gives the same results as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/bin/e_comp_wl.c | 19 ++++++++++++++++---
src/tests/wayland/test_pointer_focus.c | 3 +++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index ad7ee9dcb..a512cb75e 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -197,6 +197,17 @@ e_comp_wl_pointer_frame_send(struct wl_resource *res)
wl_pointer_send_frame(res);
}
+/* The move grabber is a smart member of the frame of the client being
+ * moved, so while it is up evas has the pointer in that frame wherever it
+ * is, and showing it crosses the pointer out of the client and back in
+ * with nothing moving. That client's pointer focus is left to
+ * e_comp_wl_pointer_focus_drop() and _e_comp_wl_pointer_focus_restore(). */
+static Eina_Bool
+_e_comp_wl_crossing_ignored(const E_Client *ec)
+{
+ return ec->moving;
+}
+
static void
_e_comp_wl_mouse_in(E_Client *ec, Evas_Event_Mouse_In *ev)
{
@@ -206,6 +217,7 @@ _e_comp_wl_mouse_in(E_Client *ec, Evas_Event_Mouse_In *ev)
uint32_t serial;
if (e_object_is_del(E_OBJECT(ec))) return;
+ if (_e_comp_wl_crossing_ignored(ec)) return;
if (!ec->comp_data->surface) return;
@@ -291,6 +303,7 @@ _e_comp_wl_pointer_leave_send(E_Client *ec)
static void
_e_comp_wl_mouse_out(E_Client *ec)
{
+ if (_e_comp_wl_crossing_ignored(ec)) return;
if ((ec == e_client_action_get()) && e_grabinput_mouse_win_get()) return;
/* FIXME? this is a hack to just reset the cursor whenever we mouse out. not sure if accurate */
{
@@ -312,9 +325,9 @@ _e_comp_wl_mouse_out(E_Client *ec)
}
/* xdg_toplevel.move and .resize: the surface "will lose the focus of the
- * device (wl_pointer, wl_touch, etc) used for the move". The evas event
- * grabber does not make evas send a mouse-out until the pointer moves, and
- * _e_comp_wl_mouse_out() refuses one for the client being moved. */
+ * device (wl_pointer, wl_touch, etc) used for the move". No resize grab
+ * makes evas send a mouse-out, and the crossings evas reports for a client
+ * being moved are ignored. */
E_API void
e_comp_wl_pointer_focus_drop(E_Client *ec)
{
diff --git a/src/tests/wayland/test_pointer_focus.c b/src/tests/wayland/test_pointer_focus.c
index 0952c1b95..f9891995e 100644
--- a/src/tests/wayland/test_pointer_focus.c
+++ b/src/tests/wayland/test_pointer_focus.c
@@ -134,6 +134,9 @@ _grab(Tk *tk, Ptr_Watch *w, struct wl_seat *seat, Tk_Toplevel *top,
if (w->leaves != leaves + 1)
tk_fail(tk, "%s: the grab did not take the pointer focus (%d leaves)",
what, w->leaves - leaves);
+ if (w->in || (w->enters != enters))
+ tk_fail(tk, "%s: entered during the grab, with the pointer still",
+ what);
tk_pointer_button(tk, BTN_LEFT, 0);
tk_settle(tk);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.