about summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-01-22 05:10:47 -0500
committerZach DeCook <zachdecook@librem.one>2022-01-22 05:10:47 -0500
commit6a432662606ed66055aafc938d6d62241a1f4876 (patch)
tree9a66071648841be4f19938c3518a90b55db42cf4 /main.c
parent1da3d9e8aa36d620cffab1861409f49b7e18cf94 (diff)
downloadsuggpicker-6a432662606ed66055aafc938d6d62241a1f4876.tar.gz
input: redraw after layout change
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index 7ee6e0a..b05dd08 100644
--- a/main.c
+++ b/main.c
@@ -380,7 +380,7 @@ show(int sigint) {
 }
 
 void
-handle_input(FILE *fd, struct key *sugg) {
+handle_input(FILE *fd, struct key *sugg, struct kbd *kb) {
 	char *line;
 	line = malloc(1024);
 
@@ -405,6 +405,8 @@ handle_input(FILE *fd, struct key *sugg) {
 		key++;
 		free(key->label);
 		key->label = NULL;
+		kbd_init_suggs(sugg, kb->w, kb->h);
+		kbd_draw_layout(kb);
 	}
 
 	free(line);
@@ -524,7 +526,7 @@ main(int argc, char **argv) {
 	while (run_display) {
 		while(layer_surface && poll(fds, 2, -1) != -1) {
 			if (fds[0].revents & POLLIN) {
-				handle_input(stdin, keyboard.suggs);
+				handle_input(stdin, keyboard.suggs, &keyboard);
 			}
 			if (wl_display_dispatch(display) == -1) {
 				break;