Changeset 41051 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 25, 2012 12:48:17 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r37712 r41051 39 39 qRegisterMetaType<CUSBDevice>("CUSBDevice"); 40 40 qRegisterMetaType<CVirtualBoxErrorInfo>("CVirtualBoxErrorInfo"); 41 qRegisterMetaType<KGuestMonitorChangedEventType>("KGuestMonitorChangedEventType"); 41 42 } 42 43 … … 225 226 break; 226 227 } 228 case KVBoxEventType_OnGuestMonitorChanged: 229 { 230 CGuestMonitorChangedEvent es(pEvent); 231 emit sigGuestMonitorChange(es.GetChangeType(), es.GetScreenId(), 232 QRect(es.GetOriginX(), es.GetOriginY(), es.GetWidth(), es.GetHeight())); 233 break; 234 } 227 235 default: break; 228 236 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r37712 r41051 76 76 void sigShowWindow(LONG64 &winId); /* use Qt::DirectConnection */ 77 77 void sigCPUExecutionCapChange(); 78 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 78 79 }; 79 80 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
r37712 r41051 80 80 << KVBoxEventType_OnCanShowWindow 81 81 << KVBoxEventType_OnShowWindow 82 << KVBoxEventType_OnCPUExecutionCapChanged; 82 << KVBoxEventType_OnCPUExecutionCapChanged 83 << KVBoxEventType_OnGuestMonitorChanged; 83 84 84 85 const CConsole &console = m_pSession->session().GetConsole(); … … 149 150 this, SIGNAL(sigCPUExecutionCapChange()), 150 151 Qt::QueuedConnection); 152 153 connect(pListener->getWrapped(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 154 this, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 155 Qt::QueuedConnection); 151 156 } 152 157 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h
r37712 r41051 51 51 #endif /* RT_OS_DARWIN */ 52 52 void sigCPUExecutionCapChange(); 53 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 53 54 54 55 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r38900 r41051 446 446 /* Machine state-change updater: */ 447 447 QObject::connect(uisession(), SIGNAL(sigMachineStateChange()), machineWindow(), SLOT(sltMachineStateChanged())); 448 449 /* Guest monitor change updater: */ 450 QObject::connect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 451 machineWindow(), SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); 448 452 } 449 453 … … 531 535 } 532 536 537 void UIMachineWindow::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect /* screenGeo */) 538 { 539 /* Ignore change events for other screens: */ 540 if (uScreenId != m_uScreenId) 541 return; 542 543 /* Ignore KGuestMonitorChangedEventType_NewOrigin change event: */ 544 if (changeType == KGuestMonitorChangedEventType_NewOrigin) 545 return; 546 547 /* Process KGuestMonitorChangedEventType_Enabled change event: */ 548 if (machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Enabled) 549 showInNecessaryMode(); 550 /* Process KGuestMonitorChangedEventType_Disabled change event: */ 551 else if (!machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Disabled) 552 machineWindow()->hide(); 553 } 554 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r30636 r41051 22 22 /* Local includes */ 23 23 #include "UIMachineDefs.h" 24 #include "COMDefs.h" 24 25 25 26 /* Global forwards */ … … 97 98 /* Protected slots: */ 98 99 virtual void sltMachineStateChanged(); 100 virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 101 102 /* Show routine: */ 103 virtual void showInNecessaryMode() = 0; 99 104 100 105 /* Protected variables: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r40870 r41051 138 138 this, SIGNAL(sigCPUExecutionCapChange())); 139 139 140 connect(gConsoleEvents, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 141 this, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); 142 140 143 /* Prepare framebuffers: */ 141 144 prepareFramebuffers(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r40273 r41051 173 173 #endif /* RT_OS_DARWIN */ 174 174 void sigCPUExecutionCapChange(); 175 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 175 176 176 177 /* Session signals: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r38348 r41051 75 75 updateAppearanceOf(UIVisualElement_AllStuff); 76 76 77 /* Make sure the window is placed on valid screen78 * before we are show fullscreen window: */79 sltPlaceOnScreen();80 81 77 /* Show fullscreen window: */ 82 showFullScreen(); 83 84 /* Make sure the window is placed on valid screen again 85 * after window is shown & window's decorations applied. 86 * That is required due to X11 Window Geometry Rules. */ 87 sltPlaceOnScreen(); 88 89 #ifdef Q_WS_MAC 90 /* Make sure it is really on the right place (especially on the Mac) */ 91 QRect r = QApplication::desktop()->screenGeometry(static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId)); 92 move(r.topLeft()); 93 #endif /* Q_WS_MAC */ 78 showInNecessaryMode(); 94 79 } 95 80 … … 129 114 { 130 115 UIMachineWindow::sltMachineStateChanged(); 116 } 117 118 void UIMachineWindowFullscreen::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo) 119 { 120 UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo); 131 121 } 132 122 … … 293 283 } 294 284 285 void UIMachineWindowFullscreen::showInNecessaryMode() 286 { 287 /* Make sure we really have to show window: */ 288 BOOL fEnabled = true; 289 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 290 session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 291 if (fEnabled) 292 { 293 /* Make sure the window is placed on valid screen 294 * before we are show fullscreen window: */ 295 sltPlaceOnScreen(); 296 297 /* Show window fullscreen: */ 298 showFullScreen(); 299 300 /* Make sure the window is placed on valid screen again 301 * after window is shown & window's decorations applied. 302 * That is required due to X11 Window Geometry Rules. */ 303 sltPlaceOnScreen(); 304 305 #ifdef Q_WS_MAC 306 /* Make sure it is really on the right place (especially on the Mac): */ 307 QRect r = QApplication::desktop()->screenGeometry(static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId)); 308 move(r.topLeft()); 309 #endif /* Q_WS_MAC */ 310 } 311 } 312 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r31284 r41051 48 48 /* Console callback handlers: */ 49 49 void sltMachineStateChanged(); 50 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 50 51 51 52 /* Popup main menu: */ … … 81 82 void updateAppearanceOf(int iElement); 82 83 84 /* Other members: */ 85 void showInNecessaryMode(); 86 83 87 /* Private variables: */ 84 88 QMenu *m_pMainMenu; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r39932 r41051 104 104 #endif /* Q_WS_MAC */ 105 105 106 /* Show window: */107 show Simple();106 /* Show normal window: */ 107 showInNecessaryMode(); 108 108 } 109 109 … … 163 163 { 164 164 updateAppearanceOf(UIVisualElement_VirtualizationStuff); 165 } 166 167 void UIMachineWindowNormal::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo) 168 { 169 UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo); 165 170 } 166 171 … … 370 375 connect(machineLogic()->uisession(), SIGNAL(sigCPUExecutionCapChange()), 371 376 this, SLOT(sltCPUExecutionCapChange())); 372 373 377 } 374 378 … … 672 676 } 673 677 674 void UIMachineWindowNormal::showSimple() 675 { 676 /* Just show window: */ 677 show(); 678 void UIMachineWindowNormal::showInNecessaryMode() 679 { 680 /* Make sure we really have to show window: */ 681 BOOL fEnabled = true; 682 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 683 session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 684 if (fEnabled) 685 show(); 678 686 } 679 687 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r39932 r41051 27 27 #include "QIWithRetranslateUI.h" 28 28 #include "UIMachineWindow.h" 29 #include "COMDefs.h"30 29 #include "UINetworkDefs.h" 31 30 … … 55 54 void sltSharedFolderChange(); 56 55 void sltCPUExecutionCapChange(); 56 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 57 57 58 58 /* LED connections: */ … … 104 104 105 105 /* Other members: */ 106 void show Simple();106 void showInNecessaryMode(); 107 107 bool isMaximizedChecked(); 108 108 void updateIndicatorState(QIStateIndicator *pIndicator, KDeviceType deviceType); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
r38348 r41051 87 87 #endif /* Q_WS_MAC */ 88 88 89 /* Show window: */90 show Simple();89 /* Show scaled window: */ 90 showInNecessaryMode(); 91 91 } 92 92 … … 111 111 { 112 112 UIMachineWindow::sltMachineStateChanged(); 113 } 114 115 void UIMachineWindowScale::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo) 116 { 117 UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo); 113 118 } 114 119 … … 360 365 } 361 366 362 void UIMachineWindowScale::showSimple() 363 { 364 /* Just show window: */ 365 show(); 367 void UIMachineWindowScale::showInNecessaryMode() 368 { 369 /* Make sure we really have to show window: */ 370 BOOL fEnabled = true; 371 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 372 session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 373 if (fEnabled) 374 show(); 366 375 } 367 376 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h
r35351 r41051 41 41 /* Console callback handlers: */ 42 42 void sltMachineStateChanged(); 43 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 43 44 44 45 /* Popup main menu: */ … … 76 77 77 78 /* Other members: */ 78 void show Simple();79 void showInNecessaryMode(); 79 80 bool isMaximizedChecked(); 80 81 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r39408 r41051 93 93 updateAppearanceOf(UIVisualElement_AllStuff); 94 94 95 /* Show window: */96 show Seamless();95 /* Show seamless window: */ 96 showInNecessaryMode(); 97 97 } 98 98 … … 134 134 { 135 135 UIMachineWindow::sltMachineStateChanged(); 136 } 137 138 void UIMachineWindowSeamless::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo) 139 { 140 UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo); 136 141 } 137 142 … … 359 364 } 360 365 361 void UIMachineWindowSeamless::showSeamless() 362 { 363 /* Show manually maximized window: */ 364 sltPlaceOnScreen(); 365 show(); 366 367 #ifdef Q_WS_MAC 368 /* Make sure it is really on the right place (especially on the Mac): */ 369 int iScreen = static_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId); 370 QRect r = vboxGlobal().availableGeometry(iScreen); 371 move(r.topLeft()); 372 #endif /* Q_WS_MAC */ 366 void UIMachineWindowSeamless::showInNecessaryMode() 367 { 368 /* Make sure we really have to show window: */ 369 BOOL fEnabled = true; 370 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 371 session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 372 if (fEnabled) 373 { 374 /* Show manually maximized window: */ 375 sltPlaceOnScreen(); 376 377 /* Show normal window: */ 378 show(); 379 380 #ifdef Q_WS_MAC 381 /* Make sure it is really on the right place (especially on the Mac): */ 382 int iScreen = static_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId); 383 QRect r = vboxGlobal().availableGeometry(iScreen); 384 move(r.topLeft()); 385 #endif /* Q_WS_MAC */ 386 } 373 387 } 374 388 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
r31284 r41051 48 48 /* Console callback handlers: */ 49 49 void sltMachineStateChanged(); 50 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 50 51 51 52 /* Popup main menu: */ … … 98 99 99 100 /* Other members: */ 100 void show Seamless();101 void showInNecessaryMode(); 101 102 void setMask(const QRegion ®ion); 102 103
Note:
See TracChangeset
for help on using the changeset viewer.