# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1314306745 0 # Node ID e8e7f048f0b87bb5753ae435b4bb064fdeb29b41 # Parent 63dd52ba9a8fde9b7b48c8ed0b3cc2a15ea2c1df Removed spinbutton workaround on Vista and higher... still needed for XP. I was hoping to be able to remove it completely but maybe later. Removed some dead code (_ResetWindow) that is no longer needed. diff -r 63dd52ba9a8f -r e8e7f048f0b8 win/dw.c --- a/win/dw.c Thu Aug 25 19:33:40 2011 +0000 +++ b/win/dw.c Thu Aug 25 21:12:25 2011 +0000 @@ -42,6 +42,7 @@ #define PACKVERSION(major,minor) MAKELONG(minor,major) #define IS_XPPLUS (dwComctlVer >= PACKVERSION(5,82)) +#define IS_VISTAPLUS (dwComctlVer >= PACKVERSION(6,10)) #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) @@ -886,21 +887,6 @@ } } -/* ResetWindow: - * Resizes window to the exact same size to trigger - * recalculation of frame. - */ -void _ResetWindow(HWND hwndFrame) -{ - RECT rcl; - - GetWindowRect(hwndFrame, &rcl); - SetWindowPos(hwndFrame, HWND_TOP, 0, 0, rcl.right - rcl.left, - rcl.bottom - rcl.top - 1, SWP_NOMOVE | SWP_NOZORDER); - SetWindowPos(hwndFrame, HWND_TOP, 0, 0, rcl.right - rcl.left, - rcl.bottom - rcl.top, SWP_NOMOVE | SWP_NOZORDER); -} - /* This function calculates how much space the widgets and boxes require * and does expansion as necessary. */ @@ -5525,7 +5511,14 @@ cinfo = calloc(1, sizeof(ColorInfo)); cinfo->buddy = buddy; - cinfo->pOldProc = SubclassWindow(tmp, _spinnerwndproc); + /* The horrible spinbutton workaround isn't necessary + * any more on Vista or 7... but still seems necessary + * for XP, so only enable it if on XP or lower. + */ + if(!IS_VISTAPLUS) + { + cinfo->pOldProc = SubclassWindow(tmp, _spinnerwndproc); + } SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); dw_window_set_font(buddy, DefaultFont);