VirtualBox

Changeset 44865 in vbox


Ignore:
Timestamp:
Feb 28, 2013 12:23:20 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Multi-screen support: Handle host-screen count change.

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

Legend:

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

    r44841 r44865  
    440440    /* Deliver event to corresponding machine-window: */
    441441    if (uScreenId < (ulong)machineWindows().size())
    442         machineWindows()[uScreenId]->handleGuestMonitorChange();
     442        machineWindows()[uScreenId]->handleScreenCountChange();
     443}
     444
     445void UIMachineLogic::sltHostScreenCountChanged(int /*cHostScreenCount*/)
     446{
     447    /* Deliver event to all machine-windows: */
     448    foreach (UIMachineWindow *pMachineWindow, machineWindows())
     449        pMachineWindow->handleScreenCountChange();
    443450}
    444451
     
    571578#endif /* Q_WS_MAC */
    572579
    573     /* Guest monitor-change updater: */
     580    /* Guest-monitor-change updater: */
    574581    connect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
    575582            this, SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)));
     583
     584    /* Host-screen-change updater: */
     585    connect(uisession(), SIGNAL(sigHostScreenCountChanged(int)),
     586            this, SLOT(sltHostScreenCountChanged(int)));
    576587}
    577588
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r44827 r44865  
    9898#endif /* RT_OS_DARWIN */
    9999    virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
     100
     101    /* Qt callback handler: */
     102    virtual void sltHostScreenCountChanged(int cHostScreenCount);
    100103
    101104protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r44827 r44865  
    605605}
    606606
    607 void UIMachineWindow::handleGuestMonitorChange()
     607void UIMachineWindow::handleScreenCountChange()
    608608{
    609609    showInNecessaryMode();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r44859 r44865  
    105105
    106106    /* Visibility stuff: */
    107     void handleGuestMonitorChange();
     107    void handleScreenCountChange();
    108108
    109109    /* Update stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r44841 r44865  
    2020/* Qt includes: */
    2121#include <QApplication>
     22#include <QDesktopWidget>
    2223#include <QWidget>
    2324#include <QTimer>
     
    104105    , m_fIsHidingHostPointer(true)
    105106{
     107    /* Prepare connections: */
     108    prepareConnections();
     109
    106110    /* Prepare console event-handlers: */
    107111    prepareConsoleEventHandlers();
     
    721725}
    722726
     727void UISession::prepareConnections()
     728{
     729    connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)),
     730            this, SIGNAL(sigHostScreenCountChanged(int)));
     731}
     732
    723733void UISession::prepareScreens()
    724734{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r44841 r44865  
    184184    void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    185185
     186    /* Qt callback signal: */
     187    void sigHostScreenCountChanged(int cHostScreenCount);
     188
    186189    /* Session signals: */
    187190    void sigMachineStarted();
     
    211214
    212215    /* Prepare helpers: */
     216    void prepareConnections();
    213217    void prepareConsoleEventHandlers();
    214218    void prepareScreens();
     
    221225    void cleanupMenuPool();
    222226    void cleanupFramebuffers();
    223     //void cleanupSession() {}
     227    //void cleanupScreens() {}
    224228    void cleanupConsoleEventHandlers();
     229    //void cleanupConnections() {}
    225230
    226231    /* Common helpers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r44861 r44865  
    134134    /* Call to base-class: */
    135135    UIMachineLogic::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
     136}
     137
     138void UIMachineLogicFullscreen::sltHostScreenCountChanged(int cScreenCount)
     139{
     140    /* Update multi-screen layout before any window update: */
     141    m_pScreenLayout->rebuild();
     142
     143    /* Call to base-class: */
     144    UIMachineLogic::sltHostScreenCountChanged(cScreenCount);
    136145}
    137146
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

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

    r44861 r44865  
    110110}
    111111
     112void UIMachineLogicSeamless::sltHostScreenCountChanged(int cScreenCount)
     113{
     114    /* Update multi-screen layout before any window update: */
     115    m_pScreenLayout->rebuild();
     116
     117    /* Call to base-class: */
     118    UIMachineLogic::sltHostScreenCountChanged(cScreenCount);
     119}
     120
    112121void UIMachineLogicSeamless::prepareActionGroups()
    113122{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h

    r44859 r44865  
    4747
    4848    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
     49    void sltHostScreenCountChanged(int cScreenCount);
    4950
    5051private:
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