From be8638f095629ad65db9381168488d8027274368 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 28 Jul 2008 02:13:35 +0000 Subject: [PATCH] svn path=/trunk/boinc/; revision=15694 --- api/graphics2_unix.C | 19 ++++++++++++------- checkin_notes | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/api/graphics2_unix.C b/api/graphics2_unix.C index 3c65ef096d..64f2b8efff 100644 --- a/api/graphics2_unix.C +++ b/api/graphics2_unix.C @@ -54,15 +54,20 @@ static bool need_show = false; bool fullscreen; -void boinc_close_window_and_quit() { +void boinc_close_window_and_quit(const char* p) { + fprintf(stderr, "Quitting: %s\n", p); exit(0); } +void boinc_close_window_and_quit_aux() { + boinc_close_window_and_quit("GLUT close"); +} + // This callback is invoked when a user presses a key. // void keyboardD(unsigned char key, int /*x*/, int /*y*/) { if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("key down"); } else { boinc_app_key_press((int) key, 0); } @@ -70,7 +75,7 @@ void keyboardD(unsigned char key, int /*x*/, int /*y*/) { void keyboardU(unsigned char key, int /*x*/, int /*y*/) { if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("key up"); } else { boinc_app_key_release((int) key, 0); } @@ -79,7 +84,7 @@ void keyboardU(unsigned char key, int /*x*/, int /*y*/) { void mouse_click(int button, int state, int x, int y){ clicked_button = button; if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("mouse click"); } else { if (state) { boinc_app_mouse_button(x, y, button, false); @@ -91,7 +96,7 @@ void mouse_click(int button, int state, int x, int y){ void mouse_click_move(int x, int y){ if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("mouse move"); } else if (clicked_button == 2){ boinc_app_mouse_move(x, y, false, false, true); } else if (clicked_button == 1){ @@ -164,7 +169,7 @@ static void make_window() { app_graphics_init(); #ifdef __APPLE__ - glutWMCloseFunc(boinc_close_window_and_quit); // Enable the window's close box + glutWMCloseFunc(boinc_close_window_and_quit_aux); // Enable the window's close box BringAppToFront(); // Show window only after a successful call to throttled_app_render(); // this avoids momentary display of old image when screensaver restarts @@ -204,7 +209,7 @@ static void timer_handler(int) { checkparentcounter = 500 / TIMER_INTERVAL_MSEC; if (getppid() == 1) { // Quit graphics application if parent process no longer running - boinc_close_window_and_quit(); + boinc_close_window_and_quit("parent dead"); } } glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0); diff --git a/checkin_notes b/checkin_notes index 26f1e30496..64e25b22a3 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5990,4 +5990,5 @@ David 27 July 2008 api/ graphics2.h + graphics2_unix.C graphics2_win.C