[PATCH 05/13] Xming: Only allow WM_MOUSEWHEEL messages to act on the client area of a focused window.

Jon TURNEY jon.turney at dronecode.org.uk
Wed Jan 7 12:04:00 PST 2009


From: Colin Harrison <colin.harrison at virgin.net>

Fix internal WM so it only allows WM_MOUSEWHEEL messages to act on the client area of a focused window.

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 hw/xwin/winmultiwindowwndproc.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 3fc3cce..3104a85 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -648,10 +648,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
       return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam);
 
     case WM_MOUSEWHEEL:
-      
-      /* Pass the message to the root window */
-      SendMessage (hwndScreen, message, wParam, lParam);
-      return 0;
+      if (SendMessage(hwnd, WM_NCHITTEST, 0, MAKELONG(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))) == HTCLIENT)
+	{
+	  /* Pass the message to the root window */
+	  SendMessage (hwndScreen, message, wParam, lParam);
+	  return 0;
+	}
+      else break;
 
     case WM_SETFOCUS:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
-- 
1.6.0.4




More information about the xorg mailing list