Changeset 98885 in vbox
- Timestamp:
- Mar 9, 2023 9:58:41 AM (21 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r98808 r98885 189 189 , m_fDataCommitted(false) 190 190 #endif 191 #ifdef VBOX_WS_MAC192 , m_enmMacOSVersion(MacOSXRelease_Old)193 #endif194 191 #ifdef VBOX_WS_X11 195 192 , m_enmWindowManagerType(X11WMType_Unknown) … … 244 241 this, &UICommon::sltHandleCommitDataRequest); 245 242 #endif /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */ 246 247 #ifdef VBOX_WS_MAC248 /* Determine OS release early: */249 m_enmMacOSVersion = determineOsRelease();250 #endif /* VBOX_WS_MAC */251 243 252 244 /* Create converter: */ … … 945 937 return settings.value(QString("%1").arg(strKey)).toString(); 946 938 } 947 948 #ifdef VBOX_WS_MAC949 /* static */950 MacOSXRelease UICommon::determineOsRelease()951 {952 /* Prepare 'utsname' struct: */953 utsname info;954 if (uname(&info) != -1)955 {956 /* Compose map of known releases: */957 QMap<int, MacOSXRelease> release;958 release[10] = MacOSXRelease_SnowLeopard;959 release[11] = MacOSXRelease_Lion;960 release[12] = MacOSXRelease_MountainLion;961 release[13] = MacOSXRelease_Mavericks;962 release[14] = MacOSXRelease_Yosemite;963 release[15] = MacOSXRelease_ElCapitan;964 965 /* Cut the major release index of the string we have, s.a. 'man uname': */966 const int iRelease = QString(info.release).section('.', 0, 0).toInt();967 968 /* Return release if determined, return 'New' if version more recent than latest, return 'Old' otherwise: */969 return release.value(iRelease, iRelease > release.keys().last() ? MacOSXRelease_New : MacOSXRelease_Old);970 }971 /* Return 'Old' by default: */972 return MacOSXRelease_Old;973 }974 #endif /* VBOX_WS_MAC */975 939 976 940 #ifdef VBOX_WS_WIN -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r98808 r98885 205 205 /** @name Host OS stuff. 206 206 * @{ */ 207 #ifdef VBOX_WS_MAC208 /** Mac OS X: Returns #MacOSXRelease determined by <i>uname</i> call. */209 static MacOSXRelease determineOsRelease();210 /** Mac OS X: Returns #MacOSXRelease determined during UICommon prepare routine. */211 MacOSXRelease osRelease() const { return m_enmMacOSVersion; }212 #endif213 214 207 #ifdef VBOX_WS_WIN 215 208 /** Loads the color theme. */ … … 649 642 /** @name Host OS stuff. 650 643 * @{ */ 651 #ifdef VBOX_WS_MAC652 /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */653 MacOSXRelease m_enmMacOSVersion;654 #endif655 656 644 #ifdef VBOX_WS_X11 657 645 /** X11: Holds the #X11WMType of the Window Manager we are running under. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r98335 r98885 98 98 99 99 100 #ifdef VBOX_WS_MAC101 /** Known macOS releases. */102 enum MacOSXRelease103 {104 MacOSXRelease_Old,105 MacOSXRelease_SnowLeopard,106 MacOSXRelease_Lion,107 MacOSXRelease_MountainLion,108 MacOSXRelease_Mavericks,109 MacOSXRelease_Yosemite,110 MacOSXRelease_ElCapitan,111 MacOSXRelease_New,112 };113 #endif /* VBOX_WS_MAC */114 115 116 100 /** Size suffixes. */ 117 101 enum SizeSuffix -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r98882 r98885 426 426 427 427 #ifdef VBOX_WS_MAC 428 /* Apply font fixes (before QApplication get created and instantiated font-hints): */429 switch (UICommon::determineOsRelease())430 {431 case MacOSXRelease_Mavericks: QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); break;432 case MacOSXRelease_Yosemite: QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Helvetica Neue"); break;433 case MacOSXRelease_ElCapitan: QFont::insertSubstitution(".SF NS Text", "Helvetica Neue"); break;434 default: break;435 }436 437 428 /* Instantiate own NSApplication before QApplication do it for us: */ 438 429 UICocoaApplication::instance(); … … 451 442 QCoreApplication::addLibraryPath(QString::fromUtf8(szExecDir)); 452 443 } 453 # endif 444 # endif /* VBOX_RUNTIME_UI */ 454 445 #endif /* VBOX_WS_MAC */ 455 446 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r98849 r98885 110 110 Q_UNUSED(uScreenId); 111 111 #ifdef VBOX_WS_MAC 112 return uiCommon().osRelease() <= MacOSXRelease_Lion ? Qt::FramelessWindowHint : 113 uScreenId == 0 || screensHaveSeparateSpaces() ? Qt::Window : Qt::FramelessWindowHint; 112 return uScreenId == 0 || screensHaveSeparateSpaces() ? Qt::Window : Qt::FramelessWindowHint; 114 113 #else /* !VBOX_WS_MAC */ 115 114 return Qt::FramelessWindowHint; … … 125 124 126 125 #ifdef VBOX_WS_MAC 127 /* For Lion and previous: */ 128 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 129 { 130 /* Make sure all machine-window(s) have proper geometry: */ 131 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 132 pMachineWindow->showInNecessaryMode(); 133 } 134 /* For ML and next revalidate native fullscreen: */ 135 else revalidateNativeFullScreen(); 126 /* Revalidate native fullscreen: */ 127 revalidateNativeFullScreen(); 136 128 #else /* !VBOX_WS_MAC */ 137 129 /* Make sure all machine-window(s) have proper geometry: */ … … 144 136 void UIMachineLogicFullscreen::sltHandleNativeFullscreenWillEnter() 145 137 { 146 /* Make sure this method is only used for ML and next: */147 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);148 149 138 /* Get sender machine-window: */ 150 139 UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender()); … … 157 146 void UIMachineLogicFullscreen::sltHandleNativeFullscreenDidEnter() 158 147 { 159 /* Make sure this method is only used for ML and next: */160 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);161 162 148 /* Get sender machine-window: */ 163 149 UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender()); … … 179 165 void UIMachineLogicFullscreen::sltHandleNativeFullscreenWillExit() 180 166 { 181 /* Make sure this method is only used for ML and next: */182 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);183 184 167 /* Get sender machine-window: */ 185 168 UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender()); … … 192 175 void UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit() 193 176 { 194 /* Make sure this method is only used for ML and next: */195 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);196 197 177 /* Get sender machine-window: */ 198 178 UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender()); … … 257 237 void UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter() 258 238 { 259 /* Make sure this method is only used for ML and next: */260 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);261 262 239 /* Get sender machine-window: */ 263 240 UIMachineWindow *pMachineWindow = qobject_cast<UIMachineWindow*>(sender()); … … 296 273 void UIMachineLogicFullscreen::sltChangeVisualStateToNormal() 297 274 { 298 /* Base-class handling for Lion and previous: */ 299 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 300 UIMachineLogic::sltChangeVisualStateToNormal(); 301 /* Special handling for ML and next: */ 302 else 303 { 304 /* Request 'normal' (window) visual-state: */ 305 uimachine()->setRequestedVisualState(UIVisualStateType_Normal); 306 /* Ask window(s) to exit 'fullscreen' mode: */ 307 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 308 } 275 /* Request 'normal' (window) visual-state: */ 276 uimachine()->setRequestedVisualState(UIVisualStateType_Normal); 277 /* Ask window(s) to exit 'fullscreen' mode: */ 278 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 309 279 } 310 280 311 281 void UIMachineLogicFullscreen::sltChangeVisualStateToSeamless() 312 282 { 313 /* Base-class handling for Lion and previous: */ 314 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 315 UIMachineLogic::sltChangeVisualStateToSeamless(); 316 /* Special handling for ML and next: */ 317 else 318 { 319 /* Request 'seamless' visual-state: */ 320 uimachine()->setRequestedVisualState(UIVisualStateType_Seamless); 321 /* Ask window(s) to exit 'fullscreen' mode: */ 322 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 323 } 283 /* Request 'seamless' visual-state: */ 284 uimachine()->setRequestedVisualState(UIVisualStateType_Seamless); 285 /* Ask window(s) to exit 'fullscreen' mode: */ 286 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 324 287 } 325 288 326 289 void UIMachineLogicFullscreen::sltChangeVisualStateToScale() 327 290 { 328 /* Base-class handling for Lion and previous: */ 329 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 330 UIMachineLogic::sltChangeVisualStateToScale(); 331 /* Special handling for ML and next: */ 332 else 333 { 334 /* Request 'scale' visual-state: */ 335 uimachine()->setRequestedVisualState(UIVisualStateType_Scale); 336 /* Ask window(s) to exit 'fullscreen' mode: */ 337 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 338 } 291 /* Request 'scale' visual-state: */ 292 uimachine()->setRequestedVisualState(UIVisualStateType_Scale); 293 /* Ask window(s) to exit 'fullscreen' mode: */ 294 emit sigNotifyAboutNativeFullscreenShouldBeExited(); 339 295 } 340 296 … … 404 360 405 361 #ifdef VBOX_WS_MAC 406 /* For Lion and previous: */ 407 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 408 { 409 /* Make sure all machine-window(s) have proper geometry: */ 410 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 411 pMachineWindow->showInNecessaryMode(); 412 } 413 /* Revalidate native fullscreen for ML and next: */ 414 else revalidateNativeFullScreen(); 362 /* Revalidate native fullscreen: */ 363 revalidateNativeFullScreen(); 415 364 #else /* !VBOX_WS_MAC */ 416 365 /* Make sure all machine-window(s) have proper geometry: */ … … 428 377 429 378 #ifdef VBOX_WS_MAC 430 /* Call to base-class for Lion and previous: */ 431 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 432 UIMachineLogic::sltGuestMonitorChange(changeType, uScreenId, screenGeo); 433 /* Revalidate native fullscreen for ML and next: */ 434 else revalidateNativeFullScreen(); 379 /* Revalidate native fullscreen: */ 380 RT_NOREF(changeType, uScreenId, screenGeo); 381 revalidateNativeFullScreen(); 435 382 #else /* !VBOX_WS_MAC */ 436 383 /* Call to base-class: */ … … 447 394 448 395 #ifdef VBOX_WS_MAC 449 /* Call to base-class for Lion and previous: */ 450 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 451 UIMachineLogic::sltHostScreenCountChange(); 452 /* Revalidate native fullscreen for ML and next: */ 453 else revalidateNativeFullScreen(); 396 /* Revalidate native fullscreen: */ 397 revalidateNativeFullScreen(); 454 398 #else /* !VBOX_WS_MAC */ 455 399 /* Call to base-class: */ … … 522 466 523 467 #ifdef VBOX_WS_MAC 524 /* For ML and next: */ 525 if (uiCommon().osRelease() > MacOSXRelease_Lion) 526 { 527 /* Register to native notifications: */ 528 UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this, 529 UIMachineLogicFullscreen::nativeHandlerForApplicationActivation); 530 UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this, 531 UIMachineLogicFullscreen::nativeHandlerForActiveSpaceChange); 532 } 468 /* Register to native notifications: */ 469 UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this, 470 UIMachineLogicFullscreen::nativeHandlerForApplicationActivation); 471 UICocoaApplication::instance()->registerToNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this, 472 UIMachineLogicFullscreen::nativeHandlerForActiveSpaceChange); 533 473 534 474 /* We have to make sure that we are getting the front most process. … … 553 493 554 494 #ifdef VBOX_WS_MAC 555 /* For ML and next: */ 556 if (uiCommon().osRelease() > MacOSXRelease_Lion) 557 { 558 /* Enable native fullscreen support: */ 559 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 560 { 561 UIMachineWindowFullscreen *pMachineWindowFullscreen = qobject_cast<UIMachineWindowFullscreen*>(pMachineWindow); 562 if (!pMachineWindow) 563 continue; 564 /* Logic => window signals: */ 565 connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeEntered, 566 pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltEnterNativeFullscreen); 567 connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeExited, 568 pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltExitNativeFullscreen); 569 /* Window => logic signals: */ 570 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillEnter, 571 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillEnter, 572 Qt::QueuedConnection); 573 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidEnter, 574 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidEnter, 575 Qt::QueuedConnection); 576 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillExit, 577 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillExit, 578 Qt::QueuedConnection); 579 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidExit, 580 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit, 581 Qt::QueuedConnection); 582 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenFailToEnter, 583 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter, 584 Qt::QueuedConnection); 585 } 586 /* Revalidate native fullscreen: */ 587 revalidateNativeFullScreen(); 588 } 495 /* Enable native fullscreen support: */ 496 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 497 { 498 UIMachineWindowFullscreen *pMachineWindowFullscreen = qobject_cast<UIMachineWindowFullscreen*>(pMachineWindow); 499 if (!pMachineWindow) 500 continue; 501 /* Logic => window signals: */ 502 connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeEntered, 503 pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltEnterNativeFullscreen); 504 connect(this, &UIMachineLogicFullscreen::sigNotifyAboutNativeFullscreenShouldBeExited, 505 pMachineWindowFullscreen, &UIMachineWindowFullscreen::sltExitNativeFullscreen); 506 /* Window => logic signals: */ 507 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillEnter, 508 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillEnter, 509 Qt::QueuedConnection); 510 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidEnter, 511 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidEnter, 512 Qt::QueuedConnection); 513 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenWillExit, 514 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenWillExit, 515 Qt::QueuedConnection); 516 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenDidExit, 517 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit, 518 Qt::QueuedConnection); 519 connect(pMachineWindowFullscreen, &UIMachineWindowFullscreen::sigNotifyAboutNativeFullscreenFailToEnter, 520 this, &UIMachineLogicFullscreen::sltHandleNativeFullscreenFailToEnter, 521 Qt::QueuedConnection); 522 } 523 /* Revalidate native fullscreen: */ 524 revalidateNativeFullScreen(); 589 525 #endif /* VBOX_WS_MAC */ 590 526 … … 637 573 638 574 #ifdef VBOX_WS_MAC 639 /* For ML and next: */ 640 if (uiCommon().osRelease() > MacOSXRelease_Lion) 641 { 642 /* Unregister from native notifications: */ 643 UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this); 644 UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this); 645 } 575 /* Unregister from native notifications: */ 576 UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceDidActivateApplicationNotification", this); 577 UICocoaApplication::instance()->unregisterFromNotificationOfWorkspace("NSWorkspaceActiveSpaceDidChangeNotification", this); 646 578 #endif/* VBOX_WS_MAC */ 647 579 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r98675 r98885 74 74 void UIMachineWindowFullscreen::handleNativeNotification(const QString &strNativeNotificationName) 75 75 { 76 /* Make sure this method is only used for ML and next: */77 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);78 79 76 /* Log all arrived notifications: */ 80 77 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: Notification '%s' received.\n", … … 170 167 void UIMachineWindowFullscreen::sltEnterNativeFullscreen(UIMachineWindow *pMachineWindow) 171 168 { 172 /* Make sure this slot is called only under ML and next: */173 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);174 175 169 /* Make sure it is NULL or 'this' window passed: */ 176 170 if (pMachineWindow && pMachineWindow != this) … … 197 191 void UIMachineWindowFullscreen::sltExitNativeFullscreen(UIMachineWindow *pMachineWindow) 198 192 { 199 /* Make sure this slot is called only under ML and next: */200 AssertReturnVoid(uiCommon().osRelease() > MacOSXRelease_Lion);201 202 193 /* Make sure it is NULL or 'this' window passed: */ 203 194 if (pMachineWindow && pMachineWindow != this) … … 252 243 253 244 #ifdef VBOX_WS_MAC 254 /* Native fullscreen stuff on ML and next: */ 255 if (uiCommon().osRelease() > MacOSXRelease_Lion) 256 { 257 /* Make sure this window has fullscreen logic: */ 258 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic()); 259 AssertPtrReturnVoid(pFullscreenLogic); 260 /* Enable fullscreen support for every screen which requires it: */ 261 if (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0) 262 darwinEnableFullscreenSupport(this); 263 /* Enable transience support for other screens: */ 264 else 265 darwinEnableTransienceSupport(this); 266 /* Register to native fullscreen notifications: */ 267 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this, 268 UIMachineWindow::handleNativeNotification); 269 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this, 270 UIMachineWindow::handleNativeNotification); 271 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillExitFullScreenNotification", this, 272 UIMachineWindow::handleNativeNotification); 273 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidExitFullScreenNotification", this, 274 UIMachineWindow::handleNativeNotification); 275 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this, 276 UIMachineWindow::handleNativeNotification); 277 } 245 /* Make sure this window has fullscreen logic: */ 246 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic()); 247 AssertPtrReturnVoid(pFullscreenLogic); 248 /* Enable fullscreen support for every screen which requires it: */ 249 if (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0) 250 darwinEnableFullscreenSupport(this); 251 /* Enable transience support for other screens: */ 252 else 253 darwinEnableTransienceSupport(this); 254 /* Register to native fullscreen notifications: */ 255 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this, 256 UIMachineWindow::handleNativeNotification); 257 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this, 258 UIMachineWindow::handleNativeNotification); 259 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillExitFullScreenNotification", this, 260 UIMachineWindow::handleNativeNotification); 261 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidExitFullScreenNotification", this, 262 UIMachineWindow::handleNativeNotification); 263 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this, 264 UIMachineWindow::handleNativeNotification); 278 265 #endif /* VBOX_WS_MAC */ 279 266 } … … 322 309 { 323 310 #ifdef VBOX_WS_MAC 324 /* Native fullscreen stuff on ML and next: */ 325 if (uiCommon().osRelease() > MacOSXRelease_Lion) 326 { 327 /* Unregister from native fullscreen notifications: */ 328 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this); 329 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this); 330 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillExitFullScreenNotification", this); 331 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidExitFullScreenNotification", this); 332 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this); 333 } 311 /* Unregister from native fullscreen notifications: */ 312 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this); 313 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this); 314 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillExitFullScreenNotification", this); 315 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidExitFullScreenNotification", this); 316 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this); 334 317 #endif /* VBOX_WS_MAC */ 335 318 … … 366 349 move(workingArea.topLeft()); 367 350 368 /* Resize window to the appropriate size on Lion and previous: */ 369 if (uiCommon().osRelease() <= MacOSXRelease_Lion) 370 resize(workingArea.size()); 371 /* Resize window to the appropriate size on ML and next if it's screen has no own user-space: */ 372 else if (!pFullscreenLogic->screensHaveSeparateSpaces() && m_uScreenId != 0) 351 /* Resize window to the appropriate size if it's screen has no own user-space: */ 352 if (!pFullscreenLogic->screensHaveSeparateSpaces() && m_uScreenId != 0) 373 353 resize(workingArea.size()); 374 354 /* Resize the window if we are already in the full screen mode. This covers cases like host-resolution changes while in full screen mode: */ 375 else if (darwinIsInFullscreenMode(this))355 else if (darwinIsInFullscreenMode(this)) 376 356 resize(workingArea.size()); 377 357 else … … 443 423 placeOnScreen(); 444 424 445 /* Simple show() for ML and next, showFullScreen() otherwise: */ 446 if (uiCommon().osRelease() > MacOSXRelease_Lion) 447 show(); 448 else 449 showFullScreen(); 425 /* Just show instead of showFullScreen: */ 426 show(); 450 427 451 428 /* Adjust machine-view size if necessary: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r98859 r98885 363 363 } 364 364 365 /* For 'Yosemite' and above: */ 366 if (uiCommon().osRelease() >= MacOSXRelease_Yosemite) 367 { 368 /* Enable fullscreen support for every screen which requires it: */ 369 if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0) 370 darwinEnableFullscreenSupport(this); 371 /* Register 'Zoom' button to use our full-screen: */ 372 UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom, 373 UIMachineWindow::handleStandardWindowButtonCallback); 374 } 365 /* Enable fullscreen support for every screen which requires it: */ 366 if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0) 367 darwinEnableFullscreenSupport(this); 368 /* Register 'Zoom' button to use our full-screen: */ 369 UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom, 370 UIMachineWindow::handleStandardWindowButtonCallback); 375 371 #endif /* VBOX_WS_MAC */ 376 372 } … … 443 439 { 444 440 #ifdef VBOX_WS_MAC 445 /* Unregister 'Zoom' button from using our full-screen since Yosemite: */ 446 if (uiCommon().osRelease() >= MacOSXRelease_Yosemite) 447 UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom); 441 /* Unregister 'Zoom' button from using our full-screen: */ 442 UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom); 448 443 #endif /* VBOX_WS_MAC */ 449 444 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
r98419 r98885 88 88 } 89 89 90 /* For 'Yosemite' and above: */ 91 if (uiCommon().osRelease() >= MacOSXRelease_Yosemite) 92 { 93 /* Enable fullscreen support for every screen which requires it: */ 94 if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0) 95 darwinEnableFullscreenSupport(this); 96 /* Register 'Zoom' button to use our full-screen: */ 97 UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom, 98 UIMachineWindow::handleStandardWindowButtonCallback); 99 } 90 /* Enable fullscreen support for every screen which requires it: */ 91 if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0) 92 darwinEnableFullscreenSupport(this); 93 /* Register 'Zoom' button to use our full-screen: */ 94 UICocoaApplication::instance()->registerCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom, 95 UIMachineWindow::handleStandardWindowButtonCallback); 100 96 } 101 97 #endif /* VBOX_WS_MAC */ … … 151 147 void UIMachineWindowScale::cleanupVisualState() 152 148 { 153 /* Unregister 'Zoom' button from using our full-screen since Yosemite: */ 154 if (uiCommon().osRelease() >= MacOSXRelease_Yosemite) 155 UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom); 149 /* Unregister 'Zoom' button from using our full-screen: */ 150 UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom); 156 151 } 157 152 #endif /* VBOX_WS_MAC */
Note:
See TracChangeset
for help on using the changeset viewer.