From 2eebe611e42c149aeafcf5bcd18c7a477c813e38 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 Aug 2014 13:44:26 +0600 Subject: [PATCH] Fix T40717: Screen does not update while scrolling or zooming with touchpad on a laptop This is rather workaround solution for now, which seems to work and it's not that huge to maintain (one liner apart from the comment). Idea is to make sure PeekMessage peeks the message when window proc receives WM_MOUSEWHEEL (some touchpad drivers seems to swallow the messages making it so PeekMessage doesn't get anything). --- intern/ghost/intern/GHOST_SystemWin32.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index ca2768ec161..8cfd2856231 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -115,6 +115,17 @@ #define VK_MEDIA_PLAY_PAUSE 0xB3 #endif // VK_MEDIA_PLAY_PAUSE +/* Workaround for some laptop touchpads, some of which seems to + * have driver issues which makes it so window function receives + * the message, but PeekMessage doesn't pick those messages for + * some reason. + * + * We send a dummy WM_USER message to force PeekMessage to receive + * something, making it so blender's window manager sees the new + * messages coming in. + */ +#define BROKEN_PEEK_TOUCHPAD + static void initRawInput() { #ifdef WITH_INPUT_NDOF @@ -1053,6 +1064,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, * until it finds a window that processes it. */ event = processWheelEvent(window, wParam, lParam); + +#ifdef BROKEN_PEEK_TOUCHPAD + PostMessage(hwnd, WM_USER, 0, 0); +#endif break; case WM_SETCURSOR: /* The WM_SETCURSOR message is sent to a window if the mouse causes the cursor