From 8ff9f243b425b93c802eabbf0cccd0b74c1c2bf3 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 26 Mar 2004 20:32:39 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3174 --- api/boinc_api.C | 3 ++- api/windows_opengl.C | 20 +++++++++++--------- checkin_notes | 16 ++++++++++++++++ client/app.C | 2 ++ client/win/wingui_mainwindow.cpp | 2 +- lib/app_ipc.C | 6 ++++++ 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/api/boinc_api.C b/api/boinc_api.C index d2bd7f808f..1d71d6c8f0 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -93,7 +93,7 @@ static void cleanup_shared_mem(); static int update_app_progress(double frac_done, double cpu_t, double cp_cpu_t, double ws_t); static int set_timer(double period); - +#ifndef _WIN32 static bool core_client_is_running() { int retval; bool running = true; @@ -107,6 +107,7 @@ static bool core_client_is_running() { } return running; } +#endif // Standard BOINC APIs // diff --git a/api/windows_opengl.C b/api/windows_opengl.C index 2e77416d24..f9d62a1f96 100755 --- a/api/windows_opengl.C +++ b/api/windows_opengl.C @@ -39,6 +39,8 @@ BOOL win_loop_done; static bool visible = true; +void KillWindow(); + void SetupPixelFormat(HDC hDC) { int nPixelFormat; @@ -128,8 +130,12 @@ static void make_new_window(int mode) { width = WindowRect.right-WindowRect.left; height = WindowRect.bottom-WindowRect.top; - ShowWindow(hWnd, SW_SHOW); - SetFocus(hWnd); + if(current_graphics_mode == MODE_FULLSCREEN || current_graphics_mode == MODE_WINDOW) { + ShowWindow(hWnd, SW_SHOW); + SetFocus(hWnd); + } else { + KillWindow(); + } app_graphics_init(); } @@ -195,7 +201,7 @@ LRESULT CALLBACK WndProc( case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: if(current_graphics_mode == MODE_FULLSCREEN) { - KillWindow(); + SetMode(MODE_HIDE_GRAPHICS); PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0); } return 0; @@ -204,7 +210,7 @@ LRESULT CALLBACK WndProc( POINT cPos; GetCursorPos(&cPos); if(cPos.x != mousePos.x || cPos.y != mousePos.y) { - KillWindow(); + SetMode(MODE_HIDE_GRAPHICS); PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0); } } @@ -279,11 +285,7 @@ static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) { if (app_client_shm->get_graphics_msg(CORE_APP_GFX_SEG, msg, new_mode)) { switch (msg) { case GRAPHICS_MSG_SET_MODE: - if (new_mode == MODE_HIDE_GRAPHICS) { - KillWindow(); - } else { - SetMode(new_mode); - } + SetMode(new_mode); break; case GRAPHICS_MSG_REREAD_PREFS: // only reread graphics prefs if we have a window open diff --git a/checkin_notes b/checkin_notes index ee5098dde5..aa49a3e8f8 100755 --- a/checkin_notes +++ b/checkin_notes @@ -10956,3 +10956,19 @@ David Mar 26 2004 html/inc/ forum.inc util.inc + +Rom Mar 26 2004 + - Fix a minor bug where after the screen saver shutdown BOINC would fire-up + a new SAH Window + - Fix a few build breaks in the Windows CC + - Tag for a 2.31 release. + + api/ + boinc_api.c + windows_opengl.c + client/ + app.c + client/win/ + wingui_mainwindow.cpp + lib/ + app_ipc.c \ No newline at end of file diff --git a/client/app.C b/client/app.C index 908e841b08..7e81a46586 100644 --- a/client/app.C +++ b/client/app.C @@ -207,7 +207,9 @@ int ACTIVE_TASK::write_app_init_file(APP_INIT_DATA& aid) { aid.host_expavg_credit = wup->project->host_expavg_credit; aid.checkpoint_period = gstate.global_prefs.disk_interval; aid.fraction_done_update_period = DEFAULT_FRACTION_DONE_UPDATE_PERIOD; +#ifndef _WIN32 aid.shm_key = 0; +#endif // when writing the wu_cpu_time to the app init file // use the total cpu time from the start of the session // (starting_cpu_time) rather than the total cpu time diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index 32b82e0553..140896206a 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -48,7 +48,7 @@ BOOL CMyApp::InitInstance() BOINC_DIAG_REDIRECTSTDOUTOVERWRITE | BOINC_DIAG_TRACETOSTDERR; - boinc_init_diag(dwDiagnosticsFlags); + boinc_init_diagnostics(dwDiagnosticsFlags); } catch (boinc_runtime_base_exception e) { diff --git a/lib/app_ipc.C b/lib/app_ipc.C index b6ca7839b5..1011ed0156 100755 --- a/lib/app_ipc.C +++ b/lib/app_ipc.C @@ -68,7 +68,9 @@ int write_init_data_file(FILE* f, APP_INIT_DATA& ai) { "%f\n" "%f\n" "%f\n" +#ifndef _WIN32 "%d\n" +#endif "%f\n" "%f\n", ai.wu_cpu_time, @@ -76,7 +78,9 @@ int write_init_data_file(FILE* f, APP_INIT_DATA& ai) { ai.user_expavg_credit, ai.host_total_credit, ai.host_expavg_credit, +#ifndef _WIN32 ai.shm_key, +#endif ai.checkpoint_period, ai.fraction_done_update_period ); @@ -104,7 +108,9 @@ int parse_init_data_file(FILE* f, APP_INIT_DATA& ai) { else if (parse_double(buf, "", ai.host_total_credit)) continue; else if (parse_double(buf, "", ai.host_expavg_credit)) continue; else if (parse_double(buf, "", ai.wu_cpu_time)) continue; +#ifndef _WIN32 else if (parse_int(buf, "", ai.shm_key)) continue; +#endif else if (parse_double(buf, "", ai.checkpoint_period)) continue; else if (parse_double(buf, "", ai.fraction_done_update_period)) continue; else fprintf(stderr, "parse_init_data_file: unrecognized %s", buf);