[weston,v2,19/21] clients/clickdot: Reset motion lines on Backspace

Submitted by Jonas Ådahl on May 13, 2015, 10:26 a.m.

Details

Message ID 1431512802-6194-20-git-send-email-jadahl@gmail.com
State Superseded
Delegated to: Daniel Stone
Headers show

Not browsing as part of any series.

Commit Message

Jonas Ådahl May 13, 2015, 10:26 a.m.
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@gmail.com>
---
 clients/clickdot.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/clients/clickdot.c b/clients/clickdot.c
index c28a596..f20581f 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -56,6 +56,7 @@  struct clickdot {
 		int32_t x, y;
 		int32_t old_x, old_y;
 	} line;
+	bool clear_lines;
 
 	int reset;
 
@@ -204,6 +205,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;
 	}
 }