Changeset 496 for trunk


Ignore:
Timestamp:
Jan 31, 2010, 9:37:50 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui/kernel: Fixed: QEvent::Enter/Leave events were delivered incorrectly if the aliend child widget belonging to a native parent intersected with a native child of this parent (for example, in applications such as smplayer, this caused extended tool bars to immediately un-extend once the mouse moves over the extended part).

File:
1 edited

Legend:

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

    r483 r496  
    641641
    642642/*
    643   Internal function called from QWidget::setCursor()
    644    force is true if this function is called from dispatchEnterLeave, it means that the
    645    mouse is actually directly under this widget.
     643    Internal function called from QWidget::setCursor()
     644
     645    force is true if this function is called from dispatchEnterLeave, it means
     646    that the mouse is actually directly under this widget.
    646647*/
    647648void qt_pm_set_cursor(QWidget *w, bool force)
     
    11071108
    11081109            case WM_U_MOUSELEAVE: {
    1109                 // We receive a mouse leave for curWin, meaning
    1110                 // the mouse was moved outside our widgets
     1110                // mp1 = hwndFrom, mp2 = hwndTo
     1111                if (hwnd != (HWND)mp1) {
     1112                    // this must be a LEAVE message from one of the frame
     1113                    // controls forwarded by WC_FRAME to FID_CLIENT; ignore it
     1114                    // as it's doesn't actually belong to the given hwnd
     1115                    break;
     1116                }
     1117                // We receive a mouse leave for curWin, meaning the mouse was
     1118                // moved outside our widgets (in any other case curWin will be
     1119                // already set to a different value in response to WM_MOUSEMOVE
     1120                // in translateMouseEvent())
    11111121                if (widget->internalWinId() == curWin) {
    11121122                    bool dispatch = !widget->underMouse();
     
    17071717    const QPoint widgetPos = mapFromGlobal(QPoint(qmsg.ptl.x, qmsg.ptl.y));
    17081718
    1709     QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
     1719    QWidget *alienWidget = !internalWinId() ? this : );
    17101720    if (alienWidget && alienWidget->internalWinId())
    17111721        alienWidget = 0;
     
    17671777                QApplicationPrivate::dispatchEnterLeave(enter, leave);
    17681778                qt_last_mouse_receiver = enter;
    1769                 curWin = enter ? enter->effectiveWinId() : 0;
     1779                curWin = ;
    17701780            }
    17711781        }
Note: See TracChangeset for help on using the changeset viewer.