8025585: Win: Popups in JFXPanel do not receive MouseWheel events
authorpchelko
Tue, 08 Oct 2013 15:54:43 +0400
changeset 20461 f9eb0540693c
parent 20460 a60499e6e190
child 20462 1b06fa1bb364
8025585: Win: Popups in JFXPanel do not receive MouseWheel events Reviewed-by: anthony, art
jdk/src/windows/native/sun/windows/awt_Toolkit.cpp
--- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	Tue Oct 08 15:17:22 2013 +0400
+++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp	Tue Oct 08 15:54:43 2013 +0400
@@ -1516,10 +1516,19 @@
      * the mouse, not the Component with the input focus.
      */
 
-    if (msg.message == WM_MOUSEWHEEL &&
-        AwtToolkit::MainThread() == ::GetWindowThreadProcessId(hWndForWheel, NULL)) {
+    if (msg.message == WM_MOUSEWHEEL) {
             //i.e. mouse is over client area for this window
-            msg.hwnd = hWndForWheel;
+            DWORD hWndForWheelProcess;
+            DWORD hWndForWheelThread = ::GetWindowThreadProcessId(hWndForWheel, &hWndForWheelProcess);
+            if (::GetCurrentProcessId() == hWndForWheelProcess) {
+                if (AwtToolkit::MainThread() == hWndForWheelThread) {
+                    msg.hwnd = hWndForWheel;
+                } else {
+                    // Interop mode, redispatch the event to another toolkit.
+                    ::SendMessage(hWndForWheel, msg.message, mouseWParam, mouseLParam);
+                    return TRUE;
+                }
+            }
     }
 
     /*