Commit 8c9909a9 authored by Olivier Fourdan's avatar Olivier Fourdan Committed by Peter Hutterer
Browse files

xwayland: Make sure we have a focus window

During the InitInput() phase, the wayland events get dequeued so we
can possibly end up calling dispatch_pointer_motion_event().

If this occurs before xwl_seat->focus_window is set, it leads to a NULL
pointer derefence and a segfault.

Check for xwl_seat->focus_window in both pointer_handle_frame() and
relative_pointer_handle_relative_motion() prior to calling
dispatch_pointer_motion_event()  like it's done in


Signed-off-by: default avatarOlivier Fourdan <>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
parent c9cbdada
......@@ -510,6 +510,9 @@ pointer_handle_frame(void *data, struct wl_pointer *wl_pointer)
struct xwl_seat *xwl_seat = data;
if (!xwl_seat->focus_window)
......@@ -560,6 +563,9 @@ relative_pointer_handle_relative_motion(void *data,
xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf);
xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf);
if (!xwl_seat->focus_window)
if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment