Skip to content
Snippets Groups Projects
Commit 27c55ac5 authored by deuce's avatar deuce
Browse files

Add the cheery_reaper() function which waits 500ms then calls exit(0). This

ensures the program quits when the user presses the exit button and the program
doesn't handle CIO_KEY_QUIT.

This still isn't the best way to do things.
parent f1b2179e
Branches
Tags
No related merge requests found
......@@ -1465,6 +1465,17 @@ int win_to_text_ypos(int winpos)
}
/* Event Thread */
/*
* This function waits 500ms then calls exit().
* It's used to handle the "close" button if the program doesn't deal
* with CIO_KEY_QUIT.
*/
void cheery_reaper(void)
{
SLEEP(500);
exit(0);
}
int sdl_video_event_thread(void *data)
{
SDL_Event ev;
......@@ -1537,6 +1548,7 @@ int sdl_video_event_thread(void *data)
break;
case SDL_QUIT:
sdl_add_key(CIO_KEY_QUIT);
cheery_reaper();
break;
case SDL_VIDEORESIZE:
if(ev.resize.w > 0 && ev.resize.h > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment