Changeset 27993 in vbox
- Timestamp:
- Apr 6, 2010 9:13:14 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59700
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r27839 r27993 43 43 #include "UIMachineWindow.h" 44 44 #include "UIMachineView.h" 45 #include "UIMachineWindowNormal.h" 46 #include "UIMachineWindowFullscreen.h" 47 #include "UIMachineWindowSeamless.h" 45 48 #include "UIMachineViewNormal.h" 46 49 #include "UIMachineViewFullscreen.h" … … 1038 1041 { 1039 1042 case QEvent::MouseMove: 1043 case QEvent::MouseButtonRelease: 1044 { 1045 /* Check if we should propagate this event to another window: */ 1046 QWidget *pWidgetAt = QApplication::widgetAt(QCursor::pos()); 1047 if (pWidgetAt && pWidgetAt->window() && pWidgetAt->window()->inherits("UIMachineWindow") && 1048 pWidgetAt->window() != machineWindowWrapper()->machineWindow()) 1049 { 1050 /* Get current mouse-move event: */ 1051 QMouseEvent *pOldMouseEvent = static_cast<QMouseEvent*>(pEvent); 1052 1053 /* Get real destination window of that event: */ 1054 UIMachineWindow *pMachineWindow = 1055 pWidgetAt->window()->inherits("UIMachineWindowNormal") ? 1056 static_cast<UIMachineWindow*>(qobject_cast<UIMachineWindowNormal*>(pWidgetAt->window())) : 1057 pWidgetAt->window()->inherits("UIMachineWindowFullscreen") ? 1058 static_cast<UIMachineWindow*>(qobject_cast<UIMachineWindowFullscreen*>(pWidgetAt->window())) : 1059 pWidgetAt->window()->inherits("UIMachineWindowSeamless") ? 1060 static_cast<UIMachineWindow*>(qobject_cast<UIMachineWindowSeamless*>(pWidgetAt->window())) : 0; 1061 if (pMachineWindow) 1062 { 1063 /* Get viewport: */ 1064 QWidget *pOtherViewport = pMachineWindow->machineView()->viewport(); 1065 1066 /* Prepare redirected mouse-move event: */ 1067 QMouseEvent *pNewMouseEvent = new QMouseEvent(pOldMouseEvent->type(), 1068 pOtherViewport->mapFromGlobal(pOldMouseEvent->globalPos()), 1069 pOldMouseEvent->globalPos(), 1070 pOldMouseEvent->button(), 1071 pOldMouseEvent->buttons(), 1072 pOldMouseEvent->modifiers()); 1073 1074 /* Send that event to real destination: */ 1075 QApplication::postEvent(pOtherViewport, pNewMouseEvent); 1076 1077 /* Filter out that event: */ 1078 return true; 1079 } 1080 } 1081 /* Else this event will be processed using next 'case': */ 1082 } 1040 1083 case QEvent::MouseButtonPress: 1041 1084 case QEvent::MouseButtonDblClick: 1042 case QEvent::MouseButtonRelease:1043 1085 { 1044 1086 QMouseEvent *pMouseEvent = static_cast<QMouseEvent*>(pEvent);
Note:
See TracChangeset
for help on using the changeset viewer.