diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-30 08:36:14 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-30 08:36:14 -0400 |
| commit | 1e7fcd818c7436397027600ec7849d3df17c5533 (patch) | |
| tree | 6a35656e9e2409a60250e948e9906ad88dd0c2c5 /common_windows.c | |
| parent | c89c59dea566853e0c5fa488f3694d5054515be4 (diff) | |
Switched from using SaveDC()/RestoreDC() to just calling SetWindowOrgEx() again in the WM_CTLCOLOR** shared handler. Doesn't fix performance the way I was hoping it would, but still better.
Diffstat (limited to 'common_windows.c')
| -rw-r--r-- | common_windows.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/common_windows.c b/common_windows.c index a8a2444..ca42eab 100644 --- a/common_windows.c +++ b/common_windows.c @@ -98,8 +98,7 @@ void paintControlBackground(HWND hwnd, HDC dc) { HWND parent; RECT r; - POINT p; - int saved; + POINT p, pOrig; WCHAR classname[128] = L""; // more than enough to avoid collisions parent = hwnd; @@ -123,12 +122,9 @@ void paintControlBackground(HWND hwnd, HDC dc) p.y = r.top; if (ScreenToClient(parent, &p) == 0) xpanic("error getting client origin of control in paintControlBackground()", GetLastError()); - saved = SaveDC(dc); - if (saved == 0) - xpanic("error saving DC info in paintControlBackground()", GetLastError()); - if (SetWindowOrgEx(dc, p.x, p.y, NULL) == 0) + if (SetWindowOrgEx(dc, p.x, p.y, &pOrig) == 0) xpanic("error moving window origin in paintControlBackground()", GetLastError()); SendMessageW(parent, WM_PRINTCLIENT, (WPARAM) dc, PRF_CLIENT); - if (RestoreDC(dc, saved) == 0) - xpanic("error restoring DC info in paintControlBackground()", GetLastError()); + if (SetWindowOrgEx(dc, pOrig.x, pOrig.y, NULL) == 0) + xpanic("error resetting window origin in paintControlBackground()", GetLastError()); } |
