VirtualBox

Changeset 52732 in vbox


Ignore:
Timestamp:
Sep 12, 2014 5:30:49 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96073
Message:

FE/Qt: Mac OS X: Runtime UI: Mini-toolbar: Should be Normal-window instead of Tool-window (latter become user-space owner instead of machine-window). Also Normal-window requirs additional handling for activation takeover.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r52730 r52732  
    185185        return;
    186186
     187#ifndef RT_OS_DARWIN
    187188    /* Revoke stolen focus: */
    188189    m_pMachineView->setFocus();
     190#else /* RT_OS_DARWIN */
     191    /* Revoke stolen activation: */
     192    activateWindow();
     193#endif /* RT_OS_DARWIN */
    189194}
    190195
     
    244249                                              gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid()));
    245250    m_pMiniToolBar->addMenus(actionPool()->menus());
     251#ifdef RT_OS_DARWIN
     252    connect(machineLogic(), SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)),
     253            m_pMiniToolBar, SLOT(sltHandle3DOverlayVisibilityChange(bool)));
     254#endif /* RT_OS_DARWIN */
    246255#ifndef RT_OS_DARWIN
    247256    connect(m_pMiniToolBar, SIGNAL(sigMinimizeAction()), this, SLOT(showMinimized()));
     
    256265            actionPool()->action(UIActionIndexRT_M_Machine_S_Close), SLOT(trigger()));
    257266#endif /* !RT_OS_DARWIN */
    258     connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), this, SLOT(sltRevokeFocus()));
     267    connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()),
     268            this, SLOT(sltRevokeFocus()), Qt::QueuedConnection);
    259269}
    260270
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r52730 r52732  
    5252                                           Qt::Alignment alignment,
    5353                                           bool fAutoHide /* = true */)
    54     : QWidget(pParent, Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint)
     54    : QWidget(pParent,
     55#ifndef RT_OS_DARWIN
     56              Qt::Tool | Qt::WindowStaysOnTopHint |
     57#else /* RT_OS_DARWIN */
     58              Qt::Window |
     59#endif /* RT_OS_DARWIN */
     60              Qt::FramelessWindowHint)
    5561    /* Variables: General stuff: */
    5662    , m_geometryType(geometryType)
     
    204210void UIRuntimeMiniToolBar::prepare()
    205211{
     212#ifdef RT_OS_DARWIN
     213    /* Install own event filter: */
     214    installEventFilter(this);
     215#endif /* RT_OS_DARWIN */
     216
    206217#ifdef VBOX_RUNTIME_UI_WITH_SHAPED_MINI_TOOLBAR
    207218    /* Make sure we have no background
     
    338349bool UIRuntimeMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent)
    339350{
     351#ifndef RT_OS_DARWIN
    340352    /* Due to Qt bug QMdiArea can
    341353     * 1. steal focus from current application focus-widget
     
    345357        pEvent->type() == QEvent::FocusIn)
    346358        emit sigNotifyAboutFocusStolen();
     359#else /* RT_OS_DARWIN */
     360    /* Due to Qt bug on Mac OS X window will be activated
     361     * even if has Qt::WA_ShowWithoutActivating attribute. */
     362    if (pWatched == this &&
     363        pEvent->type() == QEvent::WindowActivate)
     364        emit sigNotifyAboutFocusStolen();
     365#endif /* RT_OS_DARWIN */
    347366    /* Call to base-class: */
    348367    return QWidget::eventFilter(pWatched, pEvent);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h

    r52727 r52732  
    9191private slots:
    9292
     93#ifdef RT_OS_DARWIN
     94    /** Handle 3D overlay visibility change. */
     95    void sltHandle3DOverlayVisibilityChange(bool fVisible) { if (fVisible) activateWindow(); }
     96#endif /* RT_OS_DARWIN */
     97
    9398    /* Handlers: Toolbar stuff: */
    9499    void sltHandleToolbarResize();
Note: See TracChangeset for help on using the changeset viewer.

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