VirtualBox

Changeset 29014 in vbox for trunk


Ignore:
Timestamp:
May 4, 2010 1:17:17 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61053
Message:

FE/Qt4-OSX: new core: make show window work, when the VM is collapsed into the dock

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
4 edited

Legend:

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

    r28849 r29014  
    434434    connect(uisession(), SIGNAL(sigRuntimeError(bool, const QString &, const QString &)),
    435435            this, SLOT(sltRuntimeError(bool, const QString &, const QString &)));
     436
     437#ifdef Q_WS_MAC
     438    /* Show windows: */
     439    connect(uisession(), SIGNAL(sigShowWindows()),
     440            this, SLOT(sltShowWindows()));
     441#endif /* Q_WS_MAC */
    436442}
    437443
     
    826832}
    827833
     834#ifdef Q_WS_MAC
     835void UIMachineLogic::sltShowWindows()
     836{
     837    for (int i=0; i < m_machineWindowsList.size(); ++i)
     838    {
     839        UIMachineWindow *pMachineWindow = m_machineWindowsList.at(i);
     840        /* Dunno what Qt thinks a window that has minimized to the dock
     841         * should be - it is not hidden, neither is it minimized. OTOH it is
     842         * marked shown and visible, but not activated. This latter isn't of
     843         * much help though, since at this point nothing is marked activated.
     844         * I might have overlooked something, but I'm buggered what if I know
     845         * what. So, I'll just always show & activate the stupid window to
     846         * make it get out of the dock when the user wishes to show a VM. */
     847        pMachineWindow->machineWindow()->raise();
     848        pMachineWindow->machineWindow()->activateWindow();
     849    }
     850}
     851#endif /* Q_WS_MAC */
     852
    828853void UIMachineLogic::sltCheckRequestedModes()
    829854{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r28800 r29014  
    135135    virtual void sltUSBDeviceStateChange(const CUSBDevice &device, bool fIsAttached, const CVirtualBoxErrorInfo &error);
    136136    virtual void sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage);
     137#ifdef RT_OS_DARWIN
     138    virtual void sltShowWindows();
     139#endif /* RT_OS_DARWIN */
    137140
    138141    /* Mode request watch dog: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r28994 r29014  
    231231
    232232/* CPU change event: */
    233 /* Noz used:
     233/* Not used:
    234234class UICPUChangeEvent : public QEvent
    235235{
     
    331331
    332332/* Can show window event: */
     333/* Not used:
    333334class UICanUIShowWindowEvent : public QEvent
    334335{
     
    338339        : QEvent((QEvent::Type)UIConsoleEventType_CanShowWindow) {}
    339340};
     341*/
    340342
    341343/* Show window event: */
     344#ifdef Q_WS_MAC
    342345class UIShowWindowEvent : public QEvent
    343346{
     
    347350        : QEvent((QEvent::Type)UIConsoleEventType_ShowWindow) {}
    348351};
     352#endif /* Q_WS_MAC */
    349353
    350354class UIConsoleCallback : VBOX_SCRIPTABLE_IMPL(IConsoleCallback)
     
    499503            return E_POINTER;
    500504
    501 #if defined (Q_WS_MAC)
     505#ifdef Q_WS_MAC
    502506        /* Let's try the simple approach first - grab the focus.
    503507         * Getting a window out of the dock (minimized or whatever it's called)
     
    516520            *puWinId = ::darwinGetCurrentProcessId();
    517521        }
    518 #else
     522#else /* Q_WS_MAC */
    519523        /* Return the ID of the top-level console window. */
    520524        *puWinId = (ULONG64)m_pEventHandler->winId();
    521 #endif
     525#endif /* !Q_WS_MAC */
    522526
    523527        return S_OK;
     
    11381142
    11391143#ifdef Q_WS_MAC
    1140         /* posted OnShowWindow */
    11411144        case UIConsoleEventType_ShowWindow:
    11421145        {
    1143             /* Dunno what Qt3 thinks a window that has minimized to the dock
    1144              * should be - it is not hidden, neither is it minimized. OTOH it is
    1145              * marked shown and visible, but not activated. This latter isn't of
    1146              * much help though, since at this point nothing is marked activated.
    1147              * I might have overlooked something, but I'm buggered what if I know
    1148              * what. So, I'll just always show & activate the stupid window to
    1149              * make it get out of the dock when the user wishes to show a VM. */
    1150 #if 0
    1151             // TODO_NEW_CORE
    1152             window()->show();
    1153             window()->activateWindow();
    1154 #endif
     1146            emit sigShowWindows();
     1147            /* Accept event: */
     1148            pEvent->accept();
    11551149            return true;
    11561150        }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r28963 r29014  
    168168    void sigSharedFolderChange();
    169169    void sigRuntimeError(bool bIsFatal, const QString &strErrorId, const QString &strMessage);
     170#ifdef RT_OS_DARWIN
     171    void sigShowWindows();
     172#endif /* RT_OS_DARWIN */
    170173
    171174    /* Session signals: */
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