Re: [AD] win32 allegro_exit() blocks on non-active Window

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> i already have run in background set, and it works (it continues to run
> whilst non-active window ).

Ok.

> i also tried setting  set_display_switch_mode( SWITCH_BACKGROUND)  just
> before the allegro_exit()
> but it hanged (blocked infinite).     i guess you can't call
> set_display_switch_mode()  when the allegro_wnd is no longer visibile.

Ouch! Where did you put exactly the call? In our code or in the library?


Does the attached patch make any difference?

-- 
Eric Botcazou
Only in /home/eric/cvs/allegro/src/win: CVS
diff -u /home/eric/cvs/allegro/src/win/wdispsw.c allegro/src/win/wdispsw.c
--- /home/eric/cvs/allegro/src/win/wdispsw.c	Thu Oct  3 23:50:00 2002
+++ allegro/src/win/wdispsw.c	Mon May 26 09:46:55 2003
@@ -39,8 +39,8 @@
 void sys_reset_switch_mode(void)
 {
    app_foreground = TRUE;
-   SetEvent(foreground_event);
-   set_display_switch_mode(SWITCH_PAUSE);
+   SetEvent(foreground_event);  /* release blocked threads */
+   set_display_switch_mode(SWITCH_BACKGROUND);
 }
 
 
diff -u /home/eric/cvs/allegro/src/win/wsystem.c allegro/src/win/wsystem.c
--- /home/eric/cvs/allegro/src/win/wsystem.c	Tue Nov 26 14:46:38 2002
+++ allegro/src/win/wsystem.c	Mon May 26 09:49:42 2003
@@ -335,6 +335,9 @@
    wnd_schedule_proc(mouse_dinput_unacquire);
    wnd_schedule_proc(joystick_dinput_unacquire);
 
+   /* restore initial switch mode */
+   sys_reset_switch_mode();
+
    /* re-size and hide window */
    SetWindowPos(allegro_wnd, HWND_TOP, wnd_rect.left, wnd_rect.top,
 		wnd_rect.right - wnd_rect.left, wnd_rect.bottom - wnd_rect.top,


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/