VirtualBox

Changeset 55350 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 21, 2015 10:34:51 AM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Reverting r99663 because it's too dangerous, need to be more sharp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r55336 r55350  
    561561                    QPoint p = QPoint(pDeltaEvent->xDelta() + m_lastMousePos.x(),
    562562                                      pDeltaEvent->yDelta() + m_lastMousePos.y());
    563                     /* Old Qt versions had a bug where mouse-buttons coming with the event were not quite valid.
    564                      * For now we will be asking the QApplication for the valid button combination instead. */
    565                     if (mouseEvent(pDeltaEvent->mouseEventType(), uScreenId, m_viewports[uScreenId]->mapFromGlobal(p), p,
    566                                    QApplication::mouseButtons(), pDeltaEvent->wheelDelta(), pDeltaEvent->orientation()))
     563                    if (mouseEvent(pDeltaEvent->mouseEventType(), uScreenId,
     564                                   m_viewports[uScreenId]->mapFromGlobal(p), p,
     565                                   pDeltaEvent->buttons(),
     566                                   pDeltaEvent->wheelDelta(), pDeltaEvent->orientation()))
    567567                        return true;
    568568                    break;
     
    639639                    QMouseEvent *pMouseEvent = static_cast<QMouseEvent*>(pEvent);
    640640                    m_iLastMouseWheelDelta = 0;
    641                     /* Old Qt versions had a bug where mouse-buttons coming with the event were not quite valid.
    642                      * For now we will be asking the QApplication for the valid button combination instead. */
    643                     if (mouseEvent(pMouseEvent->type(), uScreenId, pMouseEvent->pos(), pMouseEvent->globalPos(),
    644                                    QApplication::mouseButtons(), 0, Qt::Horizontal))
     641                    if (mouseEvent(pMouseEvent->type(), uScreenId,
     642                                   pMouseEvent->pos(), pMouseEvent->globalPos(),
     643                                   pMouseEvent->buttons(), 0, Qt::Horizontal))
    645644                        return true;
    646645                    break;
     
    668667                        m_iLastMouseWheelDelta = m_iLastMouseWheelDelta % 120;
    669668                    }
    670                     /* Old Qt versions had a bug where mouse-buttons coming with the event were not quite valid.
    671                      * For now we will be asking the QApplication for the valid button combination instead. */
    672                     if (mouseEvent(pWheelEvent->type(), uScreenId, pWheelEvent->pos(), pWheelEvent->globalPos(),
    673                                    QApplication::mouseButtons(), iDelta, pWheelEvent->orientation()))
     669                    if (mouseEvent(pWheelEvent->type(), uScreenId,
     670                                   pWheelEvent->pos(), pWheelEvent->globalPos(),
     671#ifdef QT_MAC_USE_COCOA
     672                                   /* Qt Cocoa is buggy. It always reports a left button pressed when the
     673                                    * mouse wheel event occurs. A workaround is to ask the application which
     674                                    * buttons are pressed currently: */
     675                                   QApplication::mouseButtons(),
     676#else /* QT_MAC_USE_COCOA */
     677                                   pWheelEvent->buttons(),
     678#endif /* !QT_MAC_USE_COCOA */
     679                                   iDelta, pWheelEvent->orientation()))
    674680                        return true;
    675681                    break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette