VirtualBox

Ignore:
Timestamp:
May 8, 2008 1:16:30 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt-OSX: Fixed a bug where the context menu event could be triggered twice.

File:
1 edited

Legend:

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

    r8170 r8705  
    158158void QIStateIndicator::mousePressEvent (QMouseEvent *aEv)
    159159{
    160     QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0);
    161     emit contextMenuRequested (this, &qme);
    162     if (qme.isAccepted())
    163         aEv->accept();
    164     else
     160    /* Do this for the left mouse button event only, cause in the case of the
     161     * right mouse button it could happen that the context menu event is
     162     * triggered twice. Also this isn't necessary for the middle mouse button
     163     * which would be some kind of overstated. */
     164    if (aEv->button() == Qt::LeftButton)
     165    {
     166        QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos(), 0);
     167        emit contextMenuRequested (this, &qme);
     168        if (qme.isAccepted())
     169            aEv->accept();
     170        else
     171            QFrame::mousePressEvent (aEv);
     172    }else
    165173        QFrame::mousePressEvent (aEv);
    166174}
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