- Timestamp:
- Mar 19, 2014 1:01:27 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r50823 r50824 22 22 #include <QMouseEvent> 23 23 #include <QTouchEvent> 24 #include <QTimer> 24 25 25 26 /* GUI includes: */ … … 426 427 } 427 428 429 void UIMouseHandler::sltMaybeActivateHoveredWindow() 430 { 431 /* Are we still have hovered window to activate? */ 432 if (m_pHoveredWindow && !m_pHoveredWindow->isActiveWindow()) 433 { 434 /* Activate it: */ 435 m_pHoveredWindow->activateWindow(); 436 #ifdef Q_WS_X11 437 /* On X11 its not enough to just activate window if you 438 * want to raise it also, so we will make it separately: */ 439 m_pHoveredWindow->raise(); 440 #endif /* Q_WS_X11 */ 441 } 442 } 443 428 444 /* Mouse-handler constructor: */ 429 445 UIMouseHandler::UIMouseHandler(UIMachineLogic *pMachineLogic) … … 597 613 QApplication::activeWindow() != pWatchedWidget->window()) 598 614 { 599 /* Activating hovered machine window: */ 600 pWatchedWidget->window()->activateWindow(); 601 #ifdef Q_WS_X11 602 /* On X11 its not enough to just activate window if you 603 * want to raise it also, so we will make it separately: */ 604 pWatchedWidget->window()->raise(); 605 #endif /* Q_WS_X11 */ 615 /* Put request for hovered window activation in 300msec: */ 616 m_pHoveredWindow = pWatchedWidget->window(); 617 QTimer::singleShot(300, this, SLOT(sltMaybeActivateHoveredWindow())); 618 } 619 else 620 { 621 /* Revoke request for hovered window activation: */ 622 m_pHoveredWindow = 0; 606 623 } 607 624 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h
r47478 r50824 25 25 #include <QMap> 26 26 #include <QRect> 27 #include <QPointer> 27 28 28 29 /* GUI includes: */ … … 86 87 virtual void sltMousePointerShapeChanged(); 87 88 89 /** Activate hovered window if any. */ 90 void sltMaybeActivateHoveredWindow(); 91 88 92 protected: 89 93 … … 126 130 QMap<ulong, QWidget*> m_viewports; 127 131 132 /** Hovered window to be activated. */ 133 QPointer<QWidget> m_pHoveredWindow; 134 128 135 /* Other mouse variables: */ 129 136 QPoint m_lastMousePos;
Note:
See TracChangeset
for help on using the changeset viewer.