From 5deac6cfd6668d741bff51da48cea316b31605a3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 11 May 2015 13:24:10 -0400 Subject: [PATCH] Made Windows resizes use SWP_NOREDRAW. This makes checking the Spaced box faster, at least. --- windows/container.c | 3 +++ windows/util.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/windows/container.c b/windows/container.c index 517fd1d0..9f66e38b 100644 --- a/windows/container.c +++ b/windows/container.c @@ -237,6 +237,9 @@ static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP if (GetClientRect(c->hwnd, &r) == 0) logLastError("error getting client rect for resize in containerWndProc()"); resize(cc, &r); + // we used SWP_NOREDRAW for each resize so we can do this here + if (InvalidateRect(c->hwnd, NULL, TRUE) == 0) + logLastError("error queueing redraw after resize in containerWndProc()"); return 0; // and this is run only on the initial parent diff --git a/windows/util.c b/windows/util.c index 4eb61b50..749d53cb 100644 --- a/windows/util.c +++ b/windows/util.c @@ -119,7 +119,7 @@ void setExStyle(HWND hwnd, DWORD exstyle) SetWindowLongPtrW(hwnd, GWL_EXSTYLE, (LONG_PTR) exstyle); } -#define swpflags (SWP_NOACTIVATE | SWP_NOOWNERZORDER) +#define swpflags (SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOREDRAW) void moveWindow(HWND hwnd, intmax_t x, intmax_t y, intmax_t width, intmax_t height) {