From fdff840db02a5d403e1423b070fd43cbbc52a07c Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 7 Nov 2013 13:13:22 -0800 Subject: [PATCH] acre-x: Don't redraw for unrecognized keypresses. Until we add double-buffering, any unnecessary redrawing causes annoying blinking. Eliminating redraws from unknown keypresses fixes at least some, (but likely not that many). --- acre-x.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acre-x.c b/acre-x.c index f0fac37..194926a 100644 --- a/acre-x.c +++ b/acre-x.c @@ -126,6 +126,7 @@ handle_events(Display *dpy, Window window, Visual *visual, XNextEvent (dpy, &xev); switch (xev.type) { case KeyPress: + need_redraw = true; keycode = xev.xkey.keycode; if (keycode == quit_code || keycode == escape_code) @@ -161,7 +162,10 @@ handle_events(Display *dpy, Window window, Visual *visual, { acre_get_x_axis_data_range (acre, &x_min, &x_max); } - need_redraw = 1; + else + { + need_redraw = false; + } break; case ConfigureNotify: width = xev.xconfigure.width; -- 2.43.0