commit 8ab1c705d3044bf35335602858aa326e4fd51527
parent 1398210a51b1df8735d22050a81fb28e39ef4447
Author: Matsuda Kenji <info@mtkn.jp>
Date: Fri, 30 Dec 2022 20:04:47 +0900
trash input during gameover menu
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ex8/main.c b/ex8/main.c
@@ -252,6 +252,9 @@ game_over(void)
x_flush();
sleep(1);
+ while(x_pending() > 0) {
+ x_next_event(NULL);
+ }
next_menu = START_MENU;
}
diff --git a/ex8/x.c b/ex8/x.c
@@ -97,6 +97,8 @@ x_next_event(char *c)
XWindowAttributes wattr;
XNextEvent(display, &event);
+ if (c == NULL)
+ return NOEVENT;
switch (event.type) {
case Expose:
XGetWindowAttributes(display, window, &wattr);