VirtualBox

Changeset 49025 in vbox


Ignore:
Timestamp:
Oct 10, 2013 12:00:25 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6982: Runtime UI: Multi-screen auto-pilot feature: Native MacOS X handling for display add/remove cases.

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

Legend:

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

    r49013 r49025  
    537537}
    538538
    539 void UIMachineLogic::sltHostScreenCountChanged(int /*cHostScreenCount*/)
     539void UIMachineLogic::sltHostScreenCountChanged()
    540540{
    541541    /* Deliver event to all machine-windows: */
     
    721721
    722722    /* Host-screen-change updaters: */
    723     connect(uisession(), SIGNAL(sigHostScreenCountChanged(int)),
    724             this, SLOT(sltHostScreenCountChanged(int)));
     723    connect(uisession(), SIGNAL(sigHostScreenCountChanged()),
     724            this, SLOT(sltHostScreenCountChanged()));
    725725    connect(uisession(), SIGNAL(sigHostScreenGeometryChanged()),
    726726            this, SLOT(sltHostScreenGeometryChanged()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r49013 r49025  
    112112
    113113    /* Qt callback handler: */
    114     virtual void sltHostScreenCountChanged(int cHostScreenCount);
     114    virtual void sltHostScreenCountChanged();
    115115    virtual void sltHostScreenGeometryChanged();
    116116
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r49015 r49025  
    8585 * Notifies about @a display configuration change.
    8686 * Corresponding change described by CoreGraphics @a flags.
    87  * UISession::sltHandleHostScreenGeometryChange() is called through @a pHandlerObject to handle this callback.
     87 * Calls for corresponding UISession slots through @a pHandlerObject to handle this callback.
    8888 *
    8989 * @note Last argument (@a pHandlerObject) must always be valid pointer to UISession object.
     90 * @note Calls for UISession::sltHandleHostScreenCountChange() if display count was changed.
     91 * @note Calls for UISession::sltHandleHostScreenGeometryChange() if display mode was changed.
    9092 */
    9193void cgDisplayReconfigurationCallback(CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *pHandlerObject)
    9294{
     95    /* Handle 'display-add' case: */
     96    if (flags & kCGDisplayAddFlag)
     97    {
     98        LogRelFlow(("UISession::cgDisplayReconfigurationCallback: Display added.\n"));
     99
     100        /* Ask receiver to handle our callback, can't believe I'm using r_c here... */
     101        UISession *pReceiver = reinterpret_cast<UISession*>(pHandlerObject);
     102        QTimer::singleShot(0, pReceiver, SLOT(sltHandleHostScreenCountChange()));
     103    }
     104    /* Handle 'display-remove' case: */
     105    else if (flags & kCGDisplayRemoveFlag)
     106    {
     107        LogRelFlow(("UISession::cgDisplayReconfigurationCallback: Display removed.\n"));
     108
     109        /* Ask receiver to handle our callback, can't believe I'm using r_c here... */
     110        UISession *pReceiver = reinterpret_cast<UISession*>(pHandlerObject);
     111        QTimer::singleShot(0, pReceiver, SLOT(sltHandleHostScreenCountChange()));
     112    }
    93113    /* Handle 'mode-set' case: */
    94     if (flags & kCGDisplaySetModeFlag)
     114    else if (flags & kCGDisplaySetModeFlag)
    95115    {
    96116        LogRelFlow(("UISession::cgDisplayReconfigurationCallback: Display mode changed.\n"));
     
    100120        QTimer::singleShot(0, pReceiver, SLOT(sltHandleHostScreenGeometryChange()));
    101121    }
     122    Q_UNUSED(display);
    102123}
    103124#endif /* Q_WS_MAC */
     
    817838}
    818839
     840void UISession::sltHandleHostScreenCountChange()
     841{
     842    LogRelFlow(("UISession: Host-screen count changed.\n"));
     843
     844    /* Notify current machine-logic: */
     845    emit sigHostScreenCountChanged();
     846}
     847
    819848void UISession::sltHandleHostScreenGeometryChange()
    820849{
     
    913942    connect(this, SIGNAL(sigCloseRuntimeUI()), this, SLOT(sltCloseRuntimeUI()));
    914943
     944    /* Install Qt display reconfiguration callbacks: */
    915945    connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)),
    916             this, SIGNAL(sigHostScreenCountChanged(int)));
    917 
    918     /* Install Qt reconfiguration callbacks: */
     946            this, SLOT(sltHandleHostScreenCountChange()));
    919947    connect(QApplication::desktop(), SIGNAL(resized(int)),
    920948            this, SLOT(sltHandleHostScreenGeometryChange()));
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r49013 r49025  
    209209
    210210    /* Notifiers: Qt callback stuff: */
    211     void sigHostScreenCountChanged(int cHostScreenCount);
     211    void sigHostScreenCountChanged();
    212212    void sigHostScreenGeometryChanged();
    213213
     
    234234    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    235235
    236     /* Handler: Host callback stuff: */
     236    /* Handlers: Host callback stuff: */
     237    void sltHandleHostScreenCountChange();
    237238    void sltHandleHostScreenGeometryChange();
    238239
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r49013 r49025  
    136136}
    137137
    138 void UIMachineLogicFullscreen::sltHostScreenCountChanged(int cScreenCount)
     138void UIMachineLogicFullscreen::sltHostScreenCountChanged()
    139139{
    140140    LogRelFlow(("UIMachineLogicFullscreen: Host-screen count changed.\n"));
     
    144144
    145145    /* Call to base-class: */
    146     UIMachineLogic::sltHostScreenCountChanged(cScreenCount);
     146    UIMachineLogic::sltHostScreenCountChanged();
    147147}
    148148
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r48920 r49025  
    5454#endif /* Q_WS_MAC */
    5555    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    56     void sltHostScreenCountChanged(int cScreenCount);
     56    void sltHostScreenCountChanged();
    5757
    5858private:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r49013 r49025  
    136136}
    137137
    138 void UIMachineLogicSeamless::sltHostScreenCountChanged(int cScreenCount)
     138void UIMachineLogicSeamless::sltHostScreenCountChanged()
    139139{
    140140    LogRelFlow(("UIMachineLogicSeamless: Host-screen count changed.\n"));
     
    144144
    145145    /* Call to base-class: */
    146     UIMachineLogic::sltHostScreenCountChanged(cScreenCount);
     146    UIMachineLogic::sltHostScreenCountChanged();
    147147}
    148148
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h

    r48920 r49025  
    5353
    5454    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    55     void sltHostScreenCountChanged(int cScreenCount);
     55    void sltHostScreenCountChanged();
    5656
    5757private:
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