[vlc-commits] msw(Win32): properly terminate vlc when SC_CLOSE received

Erwan Tulou git at videolan.org
Fri Jan 28 19:29:34 CET 2011


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Fri Jan 28 15:45:53 2011 +0100| [7b18ec43935a5e70ee8506b2fcb3e230b78b44d4] | committer: Erwan Tulou

msw(Win32): properly terminate vlc when SC_CLOSE received

Same rationale as previous patch about Linux.

fix trac #4440 (to be tested)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b18ec43935a5e70ee8506b2fcb3e230b78b44d4
---

 modules/video_output/msw/events.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index def6f7e..937d800 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -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 &&



More information about the vlc-commits mailing list