Changeset 51248 in vbox
- Timestamp:
- May 13, 2014 4:34:19 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
-
platform/darwin/UICocoaApplication.mm (modified) (2 diffs)
-
runtime/fullscreen/UIMachineLogicFullscreen.cpp (modified) (4 diffs)
-
runtime/fullscreen/UIMachineLogicFullscreen.h (modified) (2 diffs)
-
runtime/fullscreen/UIMachineWindowFullscreen.cpp (modified) (3 diffs)
-
runtime/fullscreen/UIMachineWindowFullscreen.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm
r50491 r51248 191 191 192 192 /* Define known notification names: */ 193 NSString *spstrWillEnterFullscreenNotification = @"NSWindowWillEnterFullScreenNotification"; 194 NSString *spstrDidEnterFullscreenNotification = @"NSWindowDidEnterFullScreenNotification"; 195 NSString *spstrWillExitFullscreenNotification = @"NSWindowWillExitFullScreenNotification"; 196 NSString *spstrDidExitFullscreenNotification = @"NSWindowDidExitFullScreenNotification"; 193 NSString *spstrWillEnterFullscreenNotification = @"NSWindowWillEnterFullScreenNotification"; 194 NSString *spstrDidEnterFullscreenNotification = @"NSWindowDidEnterFullScreenNotification"; 195 NSString *spstrWillExitFullscreenNotification = @"NSWindowWillExitFullScreenNotification"; 196 NSString *spstrDidExitFullscreenNotification = @"NSWindowDidExitFullScreenNotification"; 197 NSString *spstrDidFailToEnterFullScreenNotification = @"NSWindowDidFailToEnterFullScreenNotification"; 197 198 198 199 /* Redirect known notifications to UICocoaApplication instance: */ … … 200 201 || [pstrName isEqualToString :spstrDidEnterFullscreenNotification] 201 202 || [pstrName isEqualToString :spstrWillExitFullscreenNotification] 202 || [pstrName isEqualToString :spstrDidExitFullscreenNotification]) 203 || [pstrName isEqualToString :spstrDidExitFullscreenNotification] 204 || [pstrName isEqualToString :spstrDidFailToEnterFullScreenNotification]) 203 205 UICocoaApplication::instance()->nativeNotificationProxy(pstrName, [notification object]); 204 206 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r51247 r51248 163 163 /* Remove machine-window from corresponding set: */ 164 164 bool fResult = m_fullscreenMachineWindows.remove(pMachineWindow); 165 AssertReturnVoid(fResult && !m_fullscreenMachineWindows.contains(pMachineWindow)); 166 Q_UNUSED(fResult); 165 AssertReturnVoid(!m_fullscreenMachineWindows.contains(pMachineWindow)); 166 167 /* We have same signal if window did fail to enter native fullscreen. 168 * In that case window missed in m_fullscreenMachineWindows, 169 * ignore this signal silently: */ 170 if (!fResult) 171 return; 167 172 168 173 /* If that window was invalidated: */ … … 210 215 } 211 216 217 void UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter() 218 { 219 /* Make sure this method is only used for ML and next: */ 220 AssertReturnVoid(vboxGlobal().osRelease() > MacOSXRelease_Lion); 221 222 /* Get sender machine-window: */ 223 UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender()); 224 AssertReturnVoid(pMachineWindow); 225 226 /* Make sure this window is not registered somewhere: */ 227 AssertReturnVoid(!m_fullscreenMachineWindows.remove(pMachineWindow)); 228 AssertReturnVoid(!m_invalidFullscreenMachineWindows.remove(pMachineWindow)); 229 230 /* If there are 'fullscreen' windows: */ 231 if (!m_fullscreenMachineWindows.isEmpty()) 232 { 233 LogRel(("UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter: " 234 "Machine-window #%d failed to enter native fullscreen, asking others to exit...\n", 235 (int)pMachineWindow->screenId())); 236 237 /* Ask window(s) to exit 'fullscreen' mode: */ 238 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 239 } 240 /* If there are no 'fullscreen' windows: */ 241 else 242 { 243 LogRel(("UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter: " 244 "Machine-window #%d failed to enter native fullscreen, requesting change visual-state to normal...\n", 245 (int)pMachineWindow->screenId())); 246 247 /* Ask session to change 'fullscreen' mode to 'normal': */ 248 uisession()->setRequestedVisualState(UIVisualStateType_Normal); 249 } 250 } 251 212 252 void UIMachineLogicFullscreen::sltChangeVisualStateToNormal() 213 253 { … … 252 292 /* Ask window(s) to exit 'fullscreen' mode: */ 253 293 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 294 } 295 } 296 297 void UIMachineLogicFullscreen::sltCheckForRequestedVisualStateType() 298 { 299 /* Do not try to change visual-state type if machine was not started yet: */ 300 if (!uisession()->isRunning() && !uisession()->isPaused()) 301 return; 302 303 /* Check requested visual-state types: */ 304 switch (uisession()->requestedVisualState()) 305 { 306 /* If 'normal' visual-state type is requested: */ 307 case UIVisualStateType_Normal: 308 { 309 LogRel(("UIMachineLogicFullscreen::sltCheckForRequestedVisualStateType: " 310 "Going 'normal' as requested...\n")); 311 uisession()->setRequestedVisualState(UIVisualStateType_Invalid); 312 uisession()->changeVisualState(UIVisualStateType_Normal); 313 break; 314 } 315 default: 316 break; 254 317 } 255 318 } … … 450 513 this, SLOT(sltHandleNativeFullscreenDidExit()), 451 514 Qt::QueuedConnection); 515 connect(pMachineWindow, SIGNAL(sigNotifyAboutNativeFullscreenFailToEnter()), 516 this, SLOT(sltHandleNativeFullscreenFailToEnter()), 517 Qt::QueuedConnection); 452 518 } 453 519 /* Revalidate 'fullscreen' windows: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r50681 r51248 67 67 /** Mac OS X: Handles native notification about 'fullscreen' exited. */ 68 68 void sltHandleNativeFullscreenDidExit(); 69 /** Mac OS X: Handles native notification about 'fullscreen' fail to enter. */ 70 void sltHandleNativeFullscreenFailToEnter(); 69 71 70 72 /** Mac OS X: Requests visual-state change from 'fullscreen' to 'normal' (window). */ … … 74 76 /** Mac OS X: Requests visual-state change from 'fullscreen' to 'scale'. */ 75 77 void sltChangeVisualStateToScale(); 78 79 /** Mac OS X: Checks if some visual-state type was requested. */ 80 void sltCheckForRequestedVisualStateType(); 76 81 #endif /* RT_OS_DARWIN */ 77 82 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r51054 r51248 92 92 "Native fullscreen mode exited, notifying listener...\n")); 93 93 emit sigNotifyAboutNativeFullscreenDidExit(); 94 } 95 /* Handle 'NSWindowDidFailToEnterFullScreenNotification' notification: */ 96 else if (strNativeNotificationName == "NSWindowDidFailToEnterFullScreenNotification") 97 { 98 /* Mark window transition complete: */ 99 m_fIsInFullscreenTransition = false; 100 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: " 101 "Native fullscreen mode fail to enter, notifying listener...\n")); 102 emit sigNotifyAboutNativeFullscreenFailToEnter(); 94 103 } 95 104 } … … 216 225 UIMachineWindow::handleNativeNotification); 217 226 UICocoaApplication::instance()->registerToNativeNotification("NSWindowDidExitFullScreenNotification", this, 227 UIMachineWindow::handleNativeNotification); 228 UICocoaApplication::instance()->registerToNativeNotification("NSWindowDidFailToEnterFullScreenNotification", this, 218 229 UIMachineWindow::handleNativeNotification); 219 230 } … … 281 292 UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowWillExitFullScreenNotification", this); 282 293 UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowDidExitFullScreenNotification", this); 294 UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowDidFailToEnterFullScreenNotification", this); 283 295 } 284 296 #endif /* Q_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r50816 r51248 41 41 /** Mac OS X: Notifies listener about native 'fullscreen' exited. */ 42 42 void sigNotifyAboutNativeFullscreenDidExit(); 43 /** Mac OS X: Notifies listener about native 'fullscreen' fail to enter. */ 44 void sigNotifyAboutNativeFullscreenFailToEnter(); 43 45 #endif /* RT_OS_DARWIN */ 44 46
Note:
See TracChangeset
for help on using the changeset viewer.

