VirtualBox

Changeset 52873 in vbox


Ignore:
Timestamp:
Sep 26, 2014 5:00:10 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Mini-toolbar rework 02 (stolen focus/activation protection).

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

Legend:

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

    r52788 r52873  
    185185        return;
    186186
    187 #ifndef RT_OS_DARWIN
     187#if   defined(Q_WS_WIN)
    188188    /* Revoke stolen focus: */
    189189    m_pMachineView->setFocus();
    190 #else /* RT_OS_DARWIN */
     190#elif defined(Q_WS_MAC)
    191191    /* Revoke stolen activation: */
    192192    activateWindow();
    193 #endif /* RT_OS_DARWIN */
     193#endif /* Q_WS_MAC */
    194194}
    195195
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r52870 r52873  
    7171        return;
    7272
     73#if   defined(Q_WS_WIN)
    7374    /* Revoke stolen focus: */
    7475    m_pMachineView->setFocus();
     76#elif defined(Q_WS_MAC)
     77    /* Revoke stolen activation: */
     78    activateWindow();
     79#endif /* Q_WS_MAC */
    7580}
    7681
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r52872 r52873  
    226226void UIRuntimeMiniToolBar::prepare()
    227227{
    228 #ifdef RT_OS_DARWIN
     228#ifdef Q_WS_MAC
    229229    /* Install own event filter: */
    230230    installEventFilter(this);
    231 #endif /* RT_OS_DARWIN */
     231#endif /* Q_WS_MAC */
    232232
    233233#if defined(Q_WS_MAC) || defined(Q_WS_WIN)
     
    296296        /* Make sure we have no focus: */
    297297        m_pEmbeddedToolbar->setFocusPolicy(Qt::NoFocus);
     298#ifdef Q_WS_WIN
     299        /* Install embedded-toolbar event filter: */
    298300        m_pEmbeddedToolbar->installEventFilter(this);
     301#endif /* Q_WS_WIN */
    299302    }
    300303
     
    365368bool UIRuntimeMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent)
    366369{
    367 #ifndef RT_OS_DARWIN
     370#if   defined(Q_WS_WIN)
    368371    /* Due to Qt bug QMdiArea can
    369372     * 1. steal focus from current application focus-widget
     
    373376        pEvent->type() == QEvent::FocusIn)
    374377        emit sigNotifyAboutFocusStolen();
    375 #else /* RT_OS_DARWIN */
     378#elif defined(Q_WS_MAC)
    376379    /* Due to Qt bug on Mac OS X window will be activated
    377380     * even if has Qt::WA_ShowWithoutActivating attribute. */
     
    379382        pEvent->type() == QEvent::WindowActivate)
    380383        emit sigNotifyAboutFocusStolen();
    381 #endif /* RT_OS_DARWIN */
     384#endif /* Q_WS_MAC */
     385
    382386    /* Call to base-class: */
    383387    return QWidget::eventFilter(pWatched, pEvent);
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