Hi All,
Attached a patch which (appears) to fix the issue of using
wl_pointer_set_focus(ptr, NULL, 0, 0) inside the compositor.
The short version: If the input has no focus_widget, then we cannot get
the default cursor from: input->focus_widget->default_cursor.
This patch will try to get the cursor image from "widget" (which is set
either from input->grab or from input->focus_widget) if it can. If input
has no grab, and no focused_widget, then it resets cursor back to
CURSOR_UNSET.
Cheers,
devilhorns
>From 021d61a9863674054a7fa5016cc25f6395d086bc Mon Sep 17 00:00:00 2001
From: Chris Michael <[email protected]>
Date: Tue, 2 Apr 2013 13:31:18 +0100
Subject: [PATCH] Fix re-entrant pointer focus issue when using
wl_pointer_set_focus(pointer, NULL, 0, 0).
When we handle pointer motion in clients, if we have a valid widget
(either from grab or focus_widget), and it does not have a motion
handler then use it's default cursor. If we have no valid widget,
reset the input cursor image to CURSOR_UNSET.
Signed-off-by: Chris Michael <[email protected]>
---
clients/window.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/clients/window.c b/clients/window.c
index 170a6c8..9d93721 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2468,8 +2468,10 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
cursor = widget->motion_handler(input->focus_widget,
input, time, sx, sy,
widget->user_data);
+ else if (widget)
+ cursor = widget->default_cursor;
else
- cursor = input->focus_widget->default_cursor;
+ cursor = CURSOR_UNSET;
input_set_pointer_image(input, cursor);
}
--
1.7.9.5
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel