]> git.sesse.net Git - vlc/commitdiff
msw(Win32): properly terminate vlc when SC_CLOSE received
authorErwan Tulou <erwan10@videolan.org>
Fri, 28 Jan 2011 14:45:53 +0000 (15:45 +0100)
committerErwan Tulou <erwan10@videolan.org>
Fri, 28 Jan 2011 18:18:56 +0000 (19:18 +0100)
Same rationale as previous patch about Linux.

fix trac #4440 (to be tested)

modules/video_output/msw/events.c

index def6f7edc310384b027aa8d8118da182f987ae30..937d8002e110ea5c5544eeb908ec16833a113bc7 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_common.h>
 #include <vlc_vout_display.h>
 #include <vlc_vout_window.h>
+#include <vlc_interface.h>
 
 #include <windows.h>
 #include <windowsx.h>
@@ -746,6 +747,15 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
     }
     vout_display_t *vd = p_event->vd;
 
+    /* Close requested by user */
+    if( message == WM_SYSCOMMAND &&
+        (wParam & 0xFFF0) == SC_CLOSE )
+    {
+        msg_Dbg( vd, "SC_CLOSE received, leaving vlc" );
+        libvlc_Quit( vd->p_libvlc );
+        return 0;
+    }
+
 #ifndef UNDER_CE
     /* Catch the screensaver and the monitor turn-off */
     if( message == WM_SYSCOMMAND &&