[vlc-commits] NPAPI: Win32, Fullscreen window now created only when needed.

Sergey Radionov git at videolan.org
Sat Jul 30 10:06:05 CEST 2011


vlc/vlc-1.1 | branch: master | Sergey Radionov <RSATom at gmail.com> | Fri Jul 29 19:41:06 2011 +0700| [81c0dfc8a4293b3098577a69f94cf1439b057a2f] | committer: Rémi Denis-Courmont

NPAPI: Win32, Fullscreen window now created only when needed.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=81c0dfc8a4293b3098577a69f94cf1439b057a2f
---

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

diff --git a/projects/mozilla/vlc_win32_fullscreen.cpp b/projects/mozilla/vlc_win32_fullscreen.cpp
index 7a2cce2..ffbe1e5 100644
--- a/projects/mozilla/vlc_win32_fullscreen.cpp
+++ b/projects/mozilla/vlc_win32_fullscreen.cpp
@@ -832,10 +832,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;
 }
 
@@ -853,6 +857,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/**/);
@@ -873,7 +881,12 @@ void VLCWindowsManager::EndFullScreen()
 
         ShowWindow(_hWindowedParentWnd, SW_SHOW);
         ShowWindow(_FSWnd->getHWND(), SW_HIDE);
-    }
+
+        if(_FSWnd){
+            _FSWnd->DestroyWindow();
+        }
+        _FSWnd = 0;
+   }
 }
 
 void VLCWindowsManager::ToggleFullScreen()



More information about the vlc-commits mailing list