# HG changeset patch # User vayne # Date 1156790422 0 # Node ID e9ea7852e8032c8454ea66865b036bacc73b29cd # Parent 7ba51e3ffca6f5172439a06872701b4107caaba6 vo_colorkey change to avoid clashes with other black windows diff -r 7ba51e3ffca6 -r e9ea7852e803 Gui/win32/gui.c --- a/Gui/win32/gui.c Mon Aug 28 18:09:58 2006 +0000 +++ b/Gui/win32/gui.c Mon Aug 28 18:40:22 2006 +0000 @@ -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; iskin->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);