Changeset 27379 in vbox
- Timestamp:
- Mar 15, 2010 6:30:56 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r27335 r27379 277 277 public: 278 278 279 UIMachineViewBlocker( QObject *pWatchedObject)279 UIMachineViewBlocker() 280 280 : QEventLoop(0) 281 281 , m_iTimerId(0) 282 282 { 283 /* Install object event watcher: */284 pWatchedObject->installEventFilter(this);285 286 283 /* Also start timer to unlock pool in case of 287 284 * required condition doesn't happens by some reason: */ … … 296 293 297 294 protected: 298 299 bool eventFilter(QObject *pWatched, QEvent *pEvent)300 {301 switch (pEvent->type())302 {303 case VBoxDefs::ResizeEventType:304 {305 /* Its a specific part related to fullscreen/seamless modes.306 * Here we are waiting for guest resize event to be sure what307 * non-normal modes successfully restored previous guest size hint.308 * And we just unlocking the 'this' blocker afterwards: */309 exit();310 return false;311 }312 default:313 break;314 }315 return QEventLoop::eventFilter(pWatched, pEvent);316 }317 295 318 296 void timerEvent(QTimerEvent *pEvent) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r27377 r27379 56 56 , m_bIsGuestAutoresizeEnabled(pMachineWindow->machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize)->isChecked()) 57 57 , m_fShouldWeDoResize(false) 58 , m_pSyncBlocker(0) 58 59 { 59 60 /* Load machine view settings: */ … … 71 72 /* Prepare console connections: */ 72 73 prepareConsoleConnections(); 74 75 /* Prepare fullscreen: */ 76 prepareFullscreen(); 73 77 74 78 /* Initialization: */ … … 162 166 pEvent->ignore(); 163 167 } 168 } 169 170 case VBoxDefs::ResizeEventType: 171 { 172 bool fResult = UIMachineView::event(pEvent); 173 if (m_pSyncBlocker && m_pSyncBlocker->isRunning()) 174 m_pSyncBlocker->quit(); 175 return fResult; 164 176 } 165 177 default: … … 238 250 } 239 251 252 void UIMachineViewFullscreen::prepareFullscreen() 253 { 254 /* Create sync-blocker: */ 255 m_pSyncBlocker = new UIMachineViewBlocker; 256 } 257 240 258 void UIMachineViewFullscreen::cleanupFullscreen() 241 259 { … … 246 264 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics()) 247 265 { 248 /* Rollback fullscreenframe-buffer size to normal: */249 UIMachineViewBlocker blocker(this);266 /* Rollback seamless frame-buffer size to normal: */ 267 machineWindowWrapper()->machineWindow()->hide(); 250 268 sltPerformGuestResize(guestSizeHint()); 251 blocker.exec(); 269 m_pSyncBlocker->exec(); 270 271 /* Request to delete sync-blocker: */ 272 m_pSyncBlocker->deleteLater(); 252 273 } 253 274 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
r27335 r27379 64 64 void prepareConnections(); 65 65 void prepareConsoleConnections(); 66 //void prepareFullscreen() {}66 void prepareFullscreen(); 67 67 68 68 /* Cleanup routines: */ … … 82 82 void maybeRestrictMinimumSize(); 83 83 84 /* Private members: */84 /* Private variables: */ 85 85 bool m_bIsGuestAutoresizeEnabled : 1; 86 86 bool m_fShouldWeDoResize : 1; 87 UIMachineViewBlocker *m_pSyncBlocker; 87 88 88 89 /* Friend classes: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r27377 r27379 54 54 , uMonitor) 55 55 , m_fShouldWeDoResize(false) 56 , m_pSyncBlocker(0) 56 57 { 57 58 /* Load machine view settings: */ … … 176 177 pEvent->ignore(); 177 178 } 179 } 180 181 case VBoxDefs::ResizeEventType: 182 { 183 bool fResult = UIMachineView::event(pEvent); 184 if (m_pSyncBlocker && m_pSyncBlocker->isRunning()) 185 m_pSyncBlocker->quit(); 186 return fResult; 187 break; 178 188 } 179 189 default: … … 256 266 /* Set seamless feature flag to the guest: */ 257 267 session().GetConsole().GetDisplay().SetSeamlessMode(true); 268 /* Create sync-blocker: */ 269 m_pSyncBlocker = new UIMachineViewBlocker; 258 270 } 259 271 … … 267 279 268 280 /* Rollback seamless frame-buffer size to normal: */ 269 UIMachineViewBlocker blocker(this);281 machineWindowWrapper()->machineWindow()->hide(); 270 282 sltPerformGuestResize(guestSizeHint()); 271 blocker.exec(); 283 m_pSyncBlocker->exec(); 284 285 /* Delete sync-blocker: */ 286 m_pSyncBlocker->deleteLater(); 272 287 } 273 288 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
r27335 r27379 83 83 bool m_fShouldWeDoResize : 1; 84 84 QRegion m_lastVisibleRegion; 85 UIMachineViewBlocker *m_pSyncBlocker; 85 86 86 87 /* Friend classes: */
Note:
See TracChangeset
for help on using the changeset viewer.