Changeset 483 for trunk/src


Ignore:
Timestamp:
Jan 28, 2010, 7:19:03 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui/kernel: Fixed: Wrong widget-relative mouse position in mouse events. This fixes problems with dragging widget splitters (separators) in applications using dock widgets (such as qdesigner).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qapplication_pm.cpp

    r452 r483  
    16731673#endif
    16741674
    1675     // Compress mouse move events
    1676     if (qmsg.msg == WM_MOUSEMOVE) {
    1677         QMSG mouseMsg;
    1678         mouseMsg.msg = WM_NULL;
    1679         while (WinPeekMsg(0, &mouseMsg, qmsg.hwnd, WM_MOUSEMOVE,
    1680                           WM_MOUSEMOVE, PM_NOREMOVE)) {
    1681                 if (mouseMsg.mp2 != qmsg.mp2)
    1682                     break; // leave the message in the queue because
    1683                            // the key state has changed
    1684                 // Remove the mouse move message
    1685                 WinPeekMsg(0, &mouseMsg, qmsg.hwnd, WM_MOUSEMOVE,
    1686                            WM_MOUSEMOVE, PM_REMOVE);
    1687         }
    1688         // Update the passed in QMSG structure with the
    1689         // most recent one.
    1690         if (mouseMsg.msg != WM_NULL) {
    1691             PQMSG pqmsg = (PQMSG)&qmsg;
    1692             pqmsg->mp1 = mouseMsg.mp1;
    1693             pqmsg->mp2 = mouseMsg.mp2;
    1694             pqmsg->time = mouseMsg.time;
    1695             pqmsg->ptl.x = (short)SHORT1FROMMP(mouseMsg.mp1);
    1696             pqmsg->ptl.y = (short)SHORT2FROMMP(mouseMsg.mp1);
    1697             WinMapWindowPoints(pqmsg->hwnd, HWND_DESKTOP, &pqmsg->ptl, 1);
    1698             // flip y coordinate
    1699             pqmsg->ptl.y = QApplication::desktop()->height() - (pqmsg->ptl.y + 1);
    1700         }
    1701     }
    1702 
    17031675    for (i = 0; mouseTbl[i] && (ULONG)mouseTbl[i] != qmsg.msg; i += 3)
    17041676        ;
     
    18131785
    18141786        gpos = qmsg.ptl;
     1787
    18151788
    18161789        Q_ASSERT(testAttribute(Qt::WA_WState_Created));
    1817 
    1818         POINTL curPos = gpos;
    1819         WinMapWindowPoints(internalWinId(), HWND_DESKTOP, &curPos, 1);
    1820 
    1821         pos.rx() = curPos.x;
    1822         pos.ry() = curPos.y;
    1823         pos = d_func()->mapFromWS(pos);
    18241790    } else {
    18251791        if (type == QEvent::MouseButtonPress && !isActiveWindow())
     
    18271793
    18281794        gpos = qmsg.ptl;
    1829         pos = mapFromGlobal(QPoint(gpos.x, gpos.y));
     1795        pos = ;
    18301796
    18311797        // mouse button pressed
Note: See TracChangeset for help on using the changeset viewer.