Changeset 50784 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 14, 2014 10:32:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r50265 r50784 548 548 case QEvent::MouseButtonRelease: 549 549 { 550 /* Get mouse-event: */ 551 QMouseEvent *pOldMouseEvent = static_cast<QMouseEvent*>(pEvent); 552 553 /* Check which viewport(s) we *probably* hover: */ 554 QWidgetList probablyHoveredViewports; 555 foreach (QWidget *pViewport, m_viewports) 556 { 557 QPoint posInViewport = pViewport->mapFromGlobal(pOldMouseEvent->globalPos()); 558 if (pViewport->geometry().contains(posInViewport)) 559 probablyHoveredViewports << pViewport; 560 } 561 /* Determine actually hovered viewport: */ 562 QWidget *pHoveredWidget = probablyHoveredViewports.isEmpty() ? 0 : 563 probablyHoveredViewports.contains(pWatchedWidget) ? pWatchedWidget : 564 probablyHoveredViewports.first(); 565 550 566 /* Check if we should propagate this event to another window: */ 551 QWidget *pHoveredWidget = QApplication::widgetAt(QCursor::pos());552 567 if (pHoveredWidget && pHoveredWidget != pWatchedWidget && m_viewports.values().contains(pHoveredWidget)) 553 568 { 554 /* Get current mouse-move event: */555 QMouseEvent *pOldMouseEvent = static_cast<QMouseEvent*>(pEvent);556 557 569 /* Prepare redirected mouse-move event: */ 558 570 QMouseEvent *pNewMouseEvent = new QMouseEvent(pOldMouseEvent->type(),
Note:
See TracChangeset
for help on using the changeset viewer.