[vlc-devel] [PATCH 3/3] win32: added support of background color changing

Sergey Radionov rsatom at gmail.com
Sat Jan 14 17:24:41 CET 2012


---
 common/win32_fullscreen.cpp |   10 +++++++++-
 common/win32_fullscreen.h   |    3 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
index 0b677cb..cc24205 100644
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -666,6 +666,10 @@ VLCHolderWnd::CreateHolderWindow(HINSTANCE hInstance,
 
 VLCHolderWnd::~VLCHolderWnd()
 {
+    if(_hBgBrush) {
+        DeleteObject(_hBgBrush);
+        _hBgBrush = 0;
+    }
 }
 
 bool VLCHolderWnd::Create(HWND hWndParent)
@@ -677,7 +681,11 @@ bool VLCHolderWnd::Create(HWND hWndParent)
 
 void VLCHolderWnd::PreRegisterWindowClass(WNDCLASS* wc)
 {
-    wc->hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
+    if( !_hBgBrush){
+        _hBgBrush = CreateSolidBrush(HtmlColor2RGB(PO()->get_bg_color()));
+    }
+
+    wc->hbrBackground = _hBgBrush;
     wc->lpszClassName = TEXT("Web Plugin VLC Window Holder Class");
 }
 
diff --git a/common/win32_fullscreen.h b/common/win32_fullscreen.h
index b0fd1e6..3ccc851 100644
--- a/common/win32_fullscreen.h
+++ b/common/win32_fullscreen.h
@@ -153,7 +153,7 @@ public:
 protected:
     VLCHolderWnd(HINSTANCE hInstance, VLCWindowsManager* WM)
         : VLCWnd(hInstance), _hMouseHook(NULL), _MouseHookThreadId(0),
-         _wm(WM), _CtrlsWnd(0) {};
+         _wm(WM), _CtrlsWnd(0), _hBgBrush(0) {};
     bool Create(HWND hWndParent);
 
     virtual void PreRegisterWindowClass(WNDCLASS* wc);
@@ -192,6 +192,7 @@ private:
 
 private:
     VLCWindowsManager* _wm;
+    HBRUSH _hBgBrush;
     VLCControlsWnd*    _CtrlsWnd;
 };
 
-- 
1.7.7.1.msysgit.0




More information about the vlc-devel mailing list