< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp

Print this page




1493                                          mouseLParam);
1494         }
1495         if (mouseComp) {
1496                 dwCurPos = dwScreenPos;
1497                 curPos.x = LOWORD(dwCurPos);
1498                 curPos.y = HIWORD(dwCurPos);
1499                 ::MapWindowPoints(HWND_DESKTOP, mouseComp->GetHWnd(),
1500                                   &curPos, 1);
1501                 mouseLParam = MAKELPARAM((WORD)curPos.x, (WORD)curPos.y);
1502             mouseComp->SendMessage(WM_AWT_MOUSEENTER, mouseWParam,
1503                                    mouseLParam);
1504         }
1505         m_lastMouseOver = mouseComp;
1506     }
1507 
1508     /*
1509      * For MouseWheelEvents, hwnd must be changed to be the Component under
1510      * the mouse, not the Component with the input focus.
1511      */
1512 
1513     if (msg.message == WM_MOUSEWHEEL) {
1514             //i.e. mouse is over client area for this window
1515             DWORD hWndForWheelProcess;
1516             DWORD hWndForWheelThread = ::GetWindowThreadProcessId(hWndForWheel, &hWndForWheelProcess);
1517             if (::GetCurrentProcessId() == hWndForWheelProcess) {
1518                 if (AwtToolkit::MainThread() == hWndForWheelThread) {
1519                     msg.hwnd = hWndForWheel;
1520                 } else {
1521                     // Interop mode, redispatch the event to another toolkit.
1522                     ::SendMessage(hWndForWheel, msg.message, mouseWParam, mouseLParam);
1523                     return TRUE;
1524                 }
1525             }
1526     }
1527 
1528     /*
1529      * Make sure we get at least one last chance to check for transitions
1530      * before we sleep
1531      */
1532     if (m_lastMouseOver && !m_timer) {
1533         m_timer = ::SetTimer(m_toolkitHWnd, IDT_AWT_MOUSECHECK, 200, 0);




1493                                          mouseLParam);
1494         }
1495         if (mouseComp) {
1496                 dwCurPos = dwScreenPos;
1497                 curPos.x = LOWORD(dwCurPos);
1498                 curPos.y = HIWORD(dwCurPos);
1499                 ::MapWindowPoints(HWND_DESKTOP, mouseComp->GetHWnd(),
1500                                   &curPos, 1);
1501                 mouseLParam = MAKELPARAM((WORD)curPos.x, (WORD)curPos.y);
1502             mouseComp->SendMessage(WM_AWT_MOUSEENTER, mouseWParam,
1503                                    mouseLParam);
1504         }
1505         m_lastMouseOver = mouseComp;
1506     }
1507 
1508     /*
1509      * For MouseWheelEvents, hwnd must be changed to be the Component under
1510      * the mouse, not the Component with the input focus.
1511      */
1512 
1513     if (msg.message == WM_MOUSEWHEEL || msg.message == WM_MOUSEHWHEEL) {
1514             //i.e. mouse is over client area for this window
1515             DWORD hWndForWheelProcess;
1516             DWORD hWndForWheelThread = ::GetWindowThreadProcessId(hWndForWheel, &hWndForWheelProcess);
1517             if (::GetCurrentProcessId() == hWndForWheelProcess) {
1518                 if (AwtToolkit::MainThread() == hWndForWheelThread) {
1519                     msg.hwnd = hWndForWheel;
1520                 } else {
1521                     // Interop mode, redispatch the event to another toolkit.
1522                     ::SendMessage(hWndForWheel, msg.message, mouseWParam, mouseLParam);
1523                     return TRUE;
1524                 }
1525             }
1526     }
1527 
1528     /*
1529      * Make sure we get at least one last chance to check for transitions
1530      * before we sleep
1531      */
1532     if (m_lastMouseOver && !m_timer) {
1533         m_timer = ::SetTimer(m_toolkitHWnd, IDT_AWT_MOUSECHECK, 200, 0);


< prev index next >