# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1325112566 0 # Node ID 50d972da558e52c336f4858cd861eb9d507167c8 # Parent 9d342b67eed5821da1b35bb821ed65e3623d7c48 Added experimental Aero translucent backgrounds on Windows 7 and Vista. Enabled with -DAEROGLASS for the time being. diff -r 9d342b67eed5 -r 50d972da558e win/dw.c --- a/win/dw.c Wed Dec 28 16:05:54 2011 +0000 +++ b/win/dw.c Wed Dec 28 22:49:26 2011 +0000 @@ -26,6 +26,9 @@ #ifdef BUILD_DLL #include "XBrowseForFolder.h" #endif +#ifdef AEROGLASS +#include +#endif #ifdef GDIPLUS /* GDI+ Headers are not C compatible... so define what we need here instead */ @@ -101,6 +104,10 @@ ULONG_PTR gdiplusToken; #endif +#ifdef AEROGLASS +HRESULT (WINAPI *_DwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS *pMarInset) = 0; +#endif + /* * MinGW Is missing a bunch of definitions * so #define them here... @@ -3523,6 +3530,9 @@ #ifdef GDIPLUS struct GdiplusStartupInput si; #endif +#ifdef AEROGLASS + HANDLE hdwm; +#endif /* Setup the private data directory */ if(argc > 0 && argv[0]) @@ -3560,7 +3570,11 @@ wc.lpfnWndProc = (WNDPROC)_wndproc; wc.cbClsExtra = 0; wc.cbWndExtra = 32; +#ifdef AEROGLASS + wc.hbrBackground = CreateSolidBrush(RGB(0,0,0)); +#else wc.hbrBackground = NULL; +#endif wc.lpszMenuName = NULL; wc.lpszClassName = ClassName; @@ -3596,7 +3610,11 @@ wc.lpfnWndProc = (WNDPROC)_framewndproc; wc.cbClsExtra = 0; wc.cbWndExtra = 32; +#ifdef AEROGLASS + wc.hbrBackground = CreateSolidBrush(RGB(0,0,0)); +#else wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_3DFACE); +#endif wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.lpszMenuName = NULL; wc.lpszClassName = FRAMECLASSNAME; @@ -3694,6 +3712,13 @@ si.SuppressExternalCodecs = FALSE; GdiplusStartup(&gdiplusToken, &si, NULL); #endif + +#ifdef AEROGLASS + /* Attempt to load the Desktop Window Manager library */ + if((hdwm = LoadLibrary("dwmapi"))) + _DwmExtendFrameIntoClientArea = (HRESULT (WINAPI *)(HWND, const MARGINS *))GetProcAddress(hdwm, "DwmExtendFrameIntoClientArea"); + +#endif return 0; } @@ -4602,6 +4627,9 @@ HWND hwndframe; Box *newbox = calloc(sizeof(Box), 1); ULONG flStyleEx = 0; +#ifdef AEROGLASS + MARGINS mar = {-1}; +#endif newbox->type = DW_VERT; newbox->vsize = newbox->hsize = SIZEEXPAND; @@ -4629,6 +4657,12 @@ if(hwndOwner) SetParent(hwndframe, hwndOwner); +#ifdef AEROGLASS + /* Attempt to enable Aero glass background on the entire window */ + if(_DwmExtendFrameIntoClientArea) + _DwmExtendFrameIntoClientArea(hwndframe, &mar); +#endif + return hwndframe; }