[PATCH weston v4 17/20] clients/clickdot: Reset motion lines on Backspace

Jonas Ådahl jadahl at gmail.com
Tue Nov 17 02:11:03 PST 2015


Clear the white lines that is drawn by pointer motions. It makes it
easier to debug pointer movements as one won't need to restart clickdot
just to get a clean plate.

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 clients/clickdot.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/clients/clickdot.c b/clients/clickdot.c
index 1597e11..130a166 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -58,6 +58,7 @@ struct clickdot {
 		int32_t x, y;
 		int32_t old_x, old_y;
 	} line;
+	bool clear_lines;
 
 	int reset;
 
@@ -206,6 +207,11 @@ key_handler(struct window *window, struct input *input, uint32_t time,
 	case XKB_KEY_Escape:
 		display_exit(clickdot->display);
 		break;
+	case XKB_KEY_BackSpace:
+		cairo_surface_destroy(clickdot->buffer);
+		clickdot->buffer = NULL;
+		window_schedule_redraw(clickdot->window);
+		break;
 	}
 }
 
-- 
2.4.3



More information about the wayland-devel mailing list