# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1324739880 0 # Node ID 5e4ced5216962125975030af7b86efb08c7c8d00 # Parent 5cfbf2715eecd7558870073f3f0930661937dc83 Changed auto-size behavior on Windows... if no window size is set on a window... It will now automatically size the window based on the packing information... instead of letting windows pick a default size... Auto positioning is unchanged. diff -r 5cfbf2715eec -r 5e4ced521696 win/dw.c --- a/win/dw.c Sat Dec 24 13:18:03 2011 +0000 +++ b/win/dw.c Sat Dec 24 15:18:00 2011 +0000 @@ -3926,7 +3926,16 @@ */ int API dw_window_show(HWND handle) { - int rc = ShowWindow(handle, SW_SHOW); + int rc; + RECT rect; + + GetClientRect(handle, &rect); + + /* If the client area is 0x0 then call the autosize routine */ + if((rect.bottom - rect.top) == 0 || (rect.right - rect.left) == 0) + dw_window_set_size(handle, 0, 0); + + rc = ShowWindow(handle, SW_SHOW); SetFocus(handle); _initial_focus(handle); return rc; @@ -4606,14 +4615,14 @@ ULONG newflags = (flStyle | WS_CLIPCHILDREN) & ~DW_FCF_TASKLIST; hwndframe = CreateWindowEx(flStyleEx, ClassName, title, newflags, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, hwndOwner, NULL, DWInstance, NULL); + 0, 0, hwndOwner, NULL, DWInstance, NULL); } else { flStyleEx |= WS_EX_TOOLWINDOW; hwndframe = CreateWindowEx(flStyleEx, ClassName, title, flStyle | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, hwndOwner, NULL, DWInstance, NULL); + 0, 0, hwndOwner, NULL, DWInstance, NULL); } SetWindowLongPtr(hwndframe, GWLP_USERDATA, (LONG_PTR)newbox);