window: Add a widget default cursor convenience helper

In a few cases, we set a motion handler just to be able to set a fixed
cursor.  This adds a default cursor helper that can be used in those cases.
In case of the 'transformed' test case, we also avoid a brief flicker
of the pointer cursor, which is set on enter when the move grab is lifted.
diff --git a/clients/flower.c b/clients/flower.c
index dac52d5..21c38bf 100644
--- a/clients/flower.c
+++ b/clients/flower.c
@@ -129,13 +129,6 @@
 	cairo_surface_destroy(surface);
 }
 
-static int
-motion_handler(struct widget *widget, struct input *input,
-	       uint32_t time, float x, float y, void *data)
-{
-	return CURSOR_HAND1;
-}
-
 static void
 button_handler(struct widget *widget,
 	       struct input *input, uint32_t time,
@@ -184,8 +177,8 @@
 
 	widget_set_resize_handler(flower.widget, resize_handler);
 	widget_set_redraw_handler(flower.widget, redraw_handler);
-	widget_set_motion_handler(flower.widget, motion_handler);
 	widget_set_button_handler(flower.widget, button_handler);
+	widget_set_default_cursor(flower.widget, CURSOR_HAND1);
 
 	window_schedule_resize(flower.window, flower.width, flower.height);
 
diff --git a/clients/transformed.c b/clients/transformed.c
index be840d9..af77e18 100644
--- a/clients/transformed.c
+++ b/clients/transformed.c
@@ -185,13 +185,6 @@
 	window_schedule_redraw(window);
 }
 
-static int
-motion_handler(struct widget *widget, struct input *input,
-	       uint32_t time, float x, float y, void *data)
-{
-	return CURSOR_BLANK;
-}
-
 static void
 button_handler(struct widget *widget,
 	       struct input *input, uint32_t time,
@@ -237,9 +230,9 @@
 	window_set_title(transformed.window, "Transformed");
 
 	widget_set_transparent(transformed.widget, 0);
+	widget_set_default_cursor(transformed.widget, CURSOR_BLANK);
 
 	widget_set_redraw_handler(transformed.widget, redraw_handler);
-	widget_set_motion_handler(transformed.widget, motion_handler);
 	widget_set_button_handler(transformed.widget, button_handler);
 
 	window_set_fullscreen_handler(transformed.window, fullscreen_handler);
diff --git a/clients/window.c b/clients/window.c
index f24f42c..20d09d5 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -253,6 +253,7 @@
 	void *user_data;
 	int opaque;
 	int tooltip_count;
+	int default_cursor;
 };
 
 struct input {
@@ -1334,6 +1335,7 @@
 	widget->opaque = 0;
 	widget->tooltip = NULL;
 	widget->tooltip_count = 0;
+	widget->default_cursor = CURSOR_LEFT_PTR;
 
 	return widget;
 }
@@ -1379,6 +1381,12 @@
 }
 
 void
+widget_set_default_cursor(struct widget *widget, int cursor)
+{
+	widget->default_cursor = cursor;
+}
+
+void
 widget_get_allocation(struct widget *widget, struct rectangle *allocation)
 {
 	*allocation = widget->allocation;
@@ -2241,7 +2249,7 @@
 		       float x, float y)
 {
 	struct widget *old, *widget;
-	int pointer = CURSOR_LEFT_PTR;
+	int cursor;
 
 	if (focus == input->focus_widget)
 		return;
@@ -2262,10 +2270,12 @@
 			widget = input->grab;
 		input->focus_widget = focus;
 		if (widget->enter_handler)
-			pointer = widget->enter_handler(focus, input, x, y,
-							widget->user_data);
+			cursor = widget->enter_handler(focus, input, x, y,
+						       widget->user_data);
+		else
+			cursor = widget->default_cursor;
 
-		input_set_pointer_image(input, pointer);
+		input_set_pointer_image(input, cursor);
 	}
 }
 
@@ -2354,7 +2364,7 @@
 	struct input *input = data;
 	struct window *window = input->pointer_focus;
 	struct widget *widget;
-	int cursor = CURSOR_LEFT_PTR;
+	int cursor;
 	float sx = wl_fixed_to_double(sx_w);
 	float sy = wl_fixed_to_double(sy_w);
 
@@ -2377,6 +2387,8 @@
 		cursor = widget->motion_handler(input->focus_widget,
 						input, time, sx, sy,
 						widget->user_data);
+	else
+		cursor = input->focus_widget->default_cursor;
 
 	input_set_pointer_image(input, cursor);
 }
diff --git a/clients/window.h b/clients/window.h
index d356df9..29bba30 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -360,6 +360,8 @@
 void
 widget_destroy(struct widget *widget);
 void
+widget_set_default_cursor(struct widget *widget, int cursor);
+void
 widget_get_allocation(struct widget *widget, struct rectangle *allocation);
 
 void