From 79a3a1d377ec34f05bf0993232e0efc30b3a96fd Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Thu, 7 Jan 2016 10:34:21 -0500 Subject: [PATCH] Implement WM_PAINT to dispatch Refresh event on Win32 --- src/api/win32/callback.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/api/win32/callback.rs b/src/api/win32/callback.rs index 0215c9f996..4a504753fd 100644 --- a/src/api/win32/callback.rs +++ b/src/api/win32/callback.rs @@ -88,6 +88,18 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT, 1 }, + winapi::WM_PAINT => { + use events::Event::Refresh; + // We could use ::GetUpdateRgn to get detailed info + // about what needs to be updated; but he Refresh event + // doesn't pass that long anywhere. + let mut ps : winapi::PAINTSTRUCT = mem::uninitialized(); + let paintdc = user32::BeginPaint(window, mem::transmute(&mut ps)); + send_event(window, Refresh); + user32::EndPaint(window, &ps); + 0 + }, + winapi::WM_SIZE => { use events::Event::Resized; let w = winapi::LOWORD(lparam as winapi::DWORD) as u32;