/* _win_switch_out: * Puts the library in the background. */ void _win_switch_out(void) { int mode; _TRACE(PREFIX_I "switch out\n"); _win_app_foreground = FALSE; key_dinput_unacquire(); mouse_dinput_unacquire(); joystick_dinput_unacquire(); midi_switch_out(); if (win_gfx_driver && win_gfx_driver->switch_out) win_gfx_driver->switch_out(); /* handle switch modes */ mode = get_display_switch_mode(); if ((mode == SWITCH_AMNESIA) || (mode == SWITCH_PAUSE)) { _TRACE(PREFIX_I "AMNESIA or PAUSE mode suspension\n"); ResetEvent(foreground_event); /* if the thread doesn't stop, lower its priority only if another window is active */ allegro_thread_priority = GetThreadPriority(allegro_thread); if ((HINSTANCE)GetWindowLong(GetForegroundWindow(), GWL_HINSTANCE) != allegro_inst) SetThreadPriority(allegro_thread, THREAD_PRIORITY_LOWEST); } _switch_out(); }
/* go_away: * Performs a switch away. */ static void go_away(void) { _switch_out(); _unix_bg_man->disable_interrupts(); if ((switch_mode == SWITCH_PAUSE) || (switch_mode == SWITCH_AMNESIA)) _al_suspend_old_timer_emulation(); /* Disable input devices while we're away */ /* __al_linux_suspend_standard_drivers(); */ _save_switch_state(switch_mode); if (gfx_driver && gfx_driver->save_video_state) gfx_driver->save_video_state(); ioctl (__al_linux_console_fd, VT_RELDISP, 1); console_active = 0; __al_linux_switching_blocked--; if ((switch_mode == SWITCH_PAUSE) || (switch_mode == SWITCH_AMNESIA)) { __al_linux_wait_for_display(); _al_resume_old_timer_emulation(); } _unix_bg_man->enable_interrupts(); }
/* _win_switch_out: * Puts the library in the background. */ void _win_switch_out(void) { _TRACE(PREFIX_I "switch out\n"); _win_app_foreground = FALSE; if (win_gfx_driver && win_gfx_driver->switch_out) win_gfx_driver->switch_out(); _switch_out(); }