From 6566a7f57d695d888650d43225844f9641414919 Mon Sep 17 00:00:00 2001 From: ArenM Date: Tue, 5 Jul 2022 12:54:33 -0400 Subject: only commit surface when it changed This is based off of a commit in wvkbd Previously wvkbd (and suggpicker) would commit a (usually unchanged) surface at the framerate of the compositor, this only commits the buffer when we render something new. --- keyboard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'keyboard.c') diff --git a/keyboard.c b/keyboard.c index 2b1506a..293a2f6 100644 --- a/keyboard.c +++ b/keyboard.c @@ -73,6 +73,7 @@ kbd_unpress_key(struct kbd *kb) { if (kb->last_press) { kbd_draw_key(kb, kb->last_press, Unpress); kb->last_press = NULL; + drwsurf_flip(kb->surf); } } @@ -83,7 +84,6 @@ kbd_release_key(struct kbd *kb) { // Important so autocompleted words get typed in time fflush(stdout); kbd_unpress_key(kb); - kbd_draw_layout(kb); } } @@ -104,6 +104,7 @@ kbd_press_key(struct kbd *kb, struct key *k) { if (k->label) { kb->last_press = k; kbd_draw_key(kb, k, Press); + drwsurf_flip(kb->surf); } } -- cgit 1.4.1