Hey Carlos, > Of sorts, as we can't honor pointer warping across the whole root window > coordinates, peek the pointer focus in this case. > > Signed-off-by: Carlos Garnacho <[email protected]> > --- > v2: Check that requester and focus window clients are the same > > hw/xwayland/xwayland.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c > index 9e1ecf8..9e24011 100644 > --- a/hw/xwayland/xwayland.c > +++ b/hw/xwayland/xwayland.c > @@ -180,6 +180,11 @@ xwl_cursor_warped_to(DeviceIntPtr device, > xwl_seat = xwl_screen_get_default_seat(xwl_screen); > > xwl_window = xwl_window_from_window(window); > + if (!xwl_window && !window->parent && > + client == wClient(xwl_seat->focus_window->window)) { > + DebugF("Warp on root window, assuming pointer focus\n"); > + xwl_window = xwl_seat->focus_window; > + } > if (!xwl_window) > return;
Just so you know, I was evaluating your patches while taking a look at bug 100740 [1] and noticed they actually crash Xwayland with the reproducer steps (basically blender with fly-mode <shift-f>) [2] - that's because the dest_win passed by blender for XIWarpPointer() is None (which is legit), so window->parent is a NULL pointer dereference. Good news though is a small change in your patch can not only fix the crash but also fix the issue with blender as well, that's [3]. Only problem is that the client matching part needs to be avoided as in the case of blender, the client is blender but the focused surface belongs to gnome-shell [4], I am not sure why... [1] https://bugs.freedesktop.org/show_bug.cgi?id=100740 [2] https://bugs.freedesktop.org/show_bug.cgi?id=100740#c6 [3] https://bugs.freedesktop.org/show_bug.cgi?id=100740#c9 [4] https://bugs.freedesktop.org/show_bug.cgi?id=100740#c10 Cheers, Olivier _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
