npapi-vlc | branch: master | Sergey Radionov <[email protected]> | Mon Aug  1 
12:54:17 2011 +0200| [55dca7a833745ea1f9e129d3445051f23e673be4] | committer: 
Jean-Baptiste Kempf

Win32, Fullscreen window now created only when needed

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=55dca7a833745ea1f9e129d3445051f23e673be4
---

 npapi/vlc_win32_fullscreen.cpp |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/npapi/vlc_win32_fullscreen.cpp b/npapi/vlc_win32_fullscreen.cpp
index 5105e6d..93801d6 100644
--- a/npapi/vlc_win32_fullscreen.cpp
+++ b/npapi/vlc_win32_fullscreen.cpp
@@ -831,10 +831,14 @@ void VLCWindowsManager::CreateWindows(HWND 
hWindowedParentWnd)
 
 void VLCWindowsManager::DestroyWindows()
 {
-    _FSWnd->DestroyWindow();
+    if(_FSWnd){
+        _FSWnd->DestroyWindow();
+    }
     _FSWnd = 0;
 
-    _HolderWnd->DestroyWindow();
+    if(_HolderWnd){
+        _HolderWnd->DestroyWindow();
+    }
     _HolderWnd = 0;
 }
 
@@ -852,6 +856,10 @@ void VLCWindowsManager::LibVlcDetach()
 void VLCWindowsManager::StartFullScreen()
 {
     if(getMD()&&!IsFullScreen()){
+        if(!_FSWnd){
+            _FSWnd= VLCFullScreenWnd::CreateFSWindow(this);
+        }
+
         SetParent(_HolderWnd->getHWND(), _FSWnd->getHWND());
         SetWindowPos(_FSWnd->getHWND(), HWND_TOPMOST, 0, 0,
                      GetSystemMetrics(SM_CXSCREEN), 
GetSystemMetrics(SM_CYSCREEN), 0/** SWP_NOZORDER**/);
@@ -872,7 +880,12 @@ void VLCWindowsManager::EndFullScreen()
 
         ShowWindow(_hWindowedParentWnd, SW_SHOW);
         ShowWindow(_FSWnd->getHWND(), SW_HIDE);
-    }
+
+        if(_FSWnd){
+            _FSWnd->DestroyWindow();
+        }
+        _FSWnd = 0;
+   }
 }
 
 void VLCWindowsManager::ToggleFullScreen()

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to