[MPlayer-cvslog] r19576 - trunk/Gui/win32/gui.c
vayne
subversion at mplayerhq.hu
Mon Aug 28 20:40:22 CEST 2006
Author: vayne
Date: Mon Aug 28 20:40:22 2006
New Revision: 19576
Modified:
trunk/Gui/win32/gui.c
Log:
vo_colorkey change to avoid clashes with other black windows
Modified: trunk/Gui/win32/gui.c
==============================================================================
--- trunk/Gui/win32/gui.c (original)
+++ trunk/Gui/win32/gui.c Mon Aug 28 20:40:22 2006
@@ -64,6 +64,9 @@
NOTIFYICONDATA nid;
int console_state = 0;
+static HBRUSH colorbrush = NULL; //Handle to colorkey brush
+static COLORREF windowcolor = RGB(255,0,255); //Windowcolor == colorkey
+
void console_toggle(void)
{
if (console_state)
@@ -603,6 +606,7 @@
RECT rect;
HDC hdc = BeginPaint(hWnd, &ps);
HDC hMemDC = CreateCompatibleDC(hdc);
+ HBRUSH blackbrush = (HBRUSH)GetStockObject(BLACK_BRUSH);
int width, height;
GetClientRect(hWnd, &rect);
width = rect.right - rect.left;
@@ -619,6 +623,8 @@
SelectObject(hMemDC, get_bitmap(hWnd));
StretchBlt(hdc, 0, 0, width, height, hMemDC, 0, 0, desc->base->bitmap[0]->width,
desc->base->bitmap[0]->height, SRCCOPY);
+ } else {
+ FillRect(GetDC(hWnd), &rect, fullscreen?blackbrush:colorbrush);
}
DeleteDC(hMemDC);
EndPaint(hWnd, &ps);
@@ -1333,7 +1339,7 @@
window_priv_t *priv = NULL;
window *desc = NULL;
int i, x = -1, y = -1;
- vo_colorkey = 0xff000000;
+ vo_colorkey = 0xff00ff;
for (i=0; i<gui->skin->windowcount; i++)
if(gui->skin->windows[i]->type == wiSub)
@@ -1345,6 +1351,8 @@
return 1;
}
+ windowcolor = vo_colorkey;
+ colorbrush = CreateSolidBrush(windowcolor);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wc.lpfnWndProc = SubProc;
wc.cbClsExtra = 0;
@@ -1352,7 +1360,7 @@
wc.hInstance = instance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = gui->icon;
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
+ wc.hbrBackground = NULL; //WM_PAINT will handle background color switching;
wc.lpszClassName = "MPlayer Sub for Windows";
wc.lpszMenuName = NULL;
RegisterClass(&wc);
More information about the MPlayer-cvslog
mailing list