VirtualBox

Ignore:
Timestamp:
Oct 6, 2015 6:08:52 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: Return Zoom botton for normal/scale-mode VM windows but make it call for zoom (instead of full-screen) unconditionally.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin-cocoa.mm

    r57973 r58064  
    182182    if (pButton != Nil)
    183183        [pButton setHidden: YES];
     184}
     185
     186void darwinDisableZoomButtonFullscreenCheckImpl(NativeNSWindowRef pWindow)
     187{
     188    NSButton *pButton = [pWindow standardWindowButton:NSWindowZoomButton];
     189    if (pButton != Nil)
     190    {
     191        /* By default there is an internal selector "_setNeedsZoom:" used.
     192         * Since El Capitan it checks if window is able to enter full-screen
     193         * and enters full-screen even if we do not want it, so we are
     194         * hacking selector to be "zoom:" instead: */
     195        [pButton setAction: @selector(zoom:)];
     196    }
    184197}
    185198
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.cpp

    r57973 r58064  
    8282{
    8383    ::darwinSetHideTitleButtonImpl(::darwinToNativeWindow(pWidget), buttonType);
     84}
     85
     86void darwinDisableZoomButtonFullscreenCheck(QWidget *pWidget)
     87{
     88    ::darwinDisableZoomButtonFullscreenCheckImpl(::darwinToNativeWindow(pWidget));
    8489}
    8590
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.h

    r57973 r58064  
    7171void darwinSetHidesAllTitleButtonsImpl(NativeNSWindowRef pWindow);
    7272void darwinSetHideTitleButtonImpl(NativeNSWindowRef pWindow, CocoaWindowButtonType buttonType);
     73void darwinDisableZoomButtonFullscreenCheckImpl(NativeNSWindowRef pWindow);
    7374void darwinLabelWindow(NativeNSWindowRef pWindow, NativeNSImageRef pImage, bool fCenter);
    7475void darwinSetShowsWindowTransparentImpl(NativeNSWindowRef pWindow, bool fEnabled);
     
    242243void darwinSetHidesAllTitleButtons(QWidget *pWidget);
    243244void darwinSetHideTitleButton(QWidget *pWidget, CocoaWindowButtonType buttonType);
     245void darwinDisableZoomButtonFullscreenCheck(QWidget *pWidget);
    244246void darwinSetShowsWindowTransparent(QWidget *pWidget, bool fEnabled);
    245247void darwinSetWindowHasShadow(QWidget *pWidget, bool fEnabled);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r57973 r58064  
    307307    /* No 'Zoom' button since El Capitan for now: */
    308308    if (vboxGlobal().osRelease() >= MacOSXRelease_ElCapitan)
    309         darwinSetHideTitleButton(this, CocoaWindowButtonType_Zoom);
     309        darwinDisableZoomButtonFullscreenCheck(this);
    310310#endif /* Q_WS_MAC */
    311311}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r57973 r58064  
    7373    /* No 'Zoom' button since El Capitan for now: */
    7474    if (vboxGlobal().osRelease() >= MacOSXRelease_ElCapitan)
    75         darwinSetHideTitleButton(this, CocoaWindowButtonType_Zoom);
     75        darwinDisableZoomButtonFullscreenCheck(this);
    7676}
    7777#endif /* Q_WS_MAC */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette