Changeset 49013 in vbox
- Timestamp:
- Oct 9, 2013 3:49:57 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r48832 r49013 544 544 } 545 545 546 void UIMachineLogic::sltHostScreenResized(int /*iHostScreenNumber*/) 547 { 546 void UIMachineLogic::sltHostScreenGeometryChanged() 547 { 548 LogRelFlow(("UIMachineLogic: Host-screen geometry changed.\n")); 549 548 550 /* Deliver event to all machine-windows: */ 549 551 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 550 pMachineWindow->handleScreen Resize();552 pMachineWindow->handleScreenGeometryChange(); 551 553 } 552 554 … … 718 720 this, SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); 719 721 720 /* Host-screen-change updater : */722 /* Host-screen-change updaters: */ 721 723 connect(uisession(), SIGNAL(sigHostScreenCountChanged(int)), 722 724 this, SLOT(sltHostScreenCountChanged(int))); 723 724 /* Host-screen-resize updaters: */ 725 connect(uisession(), SIGNAL(sigHostScreenFullGeometryResized(int)), 726 this, SLOT(sltHostScreenResized(int))); 727 connect(uisession(), SIGNAL(sigHostScreenAvailableGeometryResized(int)), 728 this, SLOT(sltHostScreenResized(int))); 725 connect(uisession(), SIGNAL(sigHostScreenGeometryChanged()), 726 this, SLOT(sltHostScreenGeometryChanged())); 729 727 } 730 728 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r48832 r49013 113 113 /* Qt callback handler: */ 114 114 virtual void sltHostScreenCountChanged(int cHostScreenCount); 115 virtual void sltHostScreen Resized(int iHostScreenNumber);115 virtual void sltHostScreenGeometryChanged(); 116 116 117 117 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r48832 r49013 439 439 } 440 440 441 void UIMachineWindow::handleScreen Resize()441 void UIMachineWindow::handleScreenGeometryChange() 442 442 { 443 443 showInNecessaryMode(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r48832 r49013 111 111 /* Visibility stuff: */ 112 112 void handleScreenCountChange(); 113 void handleScreen Resize();113 void handleScreenGeometryChange(); 114 114 115 115 /* Update stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r48920 r49013 22 22 #include <QDesktopWidget> 23 23 #include <QWidget> 24 #ifdef Q_WS_MAC 25 # include <QTimer> 26 #endif /* Q_WS_MAC */ 24 27 25 28 /* GUI includes: */ … … 41 44 # include "VBoxFBOverlay.h" 42 45 #endif /* VBOX_WITH_VIDEOHWACCEL */ 46 #ifdef Q_WS_MAC 47 # include "VBoxUtils-darwin.h" 48 #endif /* Q_WS_MAC */ 43 49 44 50 #ifdef Q_WS_X11 … … 72 78 #include "CSnapshot.h" 73 79 #include "CMedium.h" 80 81 #ifdef Q_WS_MAC 82 /** 83 * Application Services: Core Graphics: Display reconfiguration callback. 84 * 85 * Notifies about @a display configuration change. 86 * Corresponding change described by CoreGraphics @a flags. 87 * UISession::sltHandleHostScreenGeometryChange() is called through @a pHandlerObject to handle this callback. 88 * 89 * @note Last argument (@a pHandlerObject) must always be valid pointer to UISession object. 90 */ 91 void cgDisplayReconfigurationCallback(CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *pHandlerObject) 92 { 93 /* Handle 'mode-set' case: */ 94 if (flags & kCGDisplaySetModeFlag) 95 { 96 /* Which resolution we received? */ 97 size_t iWid = CGDisplayPixelsWide(display); 98 size_t iHig = CGDisplayPixelsHigh(display); 99 LogRelFlow(("UISession::cgDisplayReconfigurationCallback: Display mode changed to: %dx%d.\n", (int)iWid, (int)iHig)); 100 101 /* Ask receiver to handle our callback, can't believe I'm using r_c here... */ 102 UISession *pReceiver = reinterpret_cast<UISession*>(pHandlerObject); 103 QTimer::singleShot(0, pReceiver, SLOT(sltHandleHostScreenGeometryChange())); 104 } 105 } 106 #endif /* Q_WS_MAC */ 74 107 75 108 UISession::UISession(UIMachine *pMachine, CSession &sessionReference) … … 787 820 } 788 821 822 void UISession::sltHandleHostScreenGeometryChange() 823 { 824 LogRelFlow(("UISession: Host-screen geometry changed.\n")); 825 826 /* Notify current machine-logic: */ 827 emit sigHostScreenGeometryChanged(); 828 } 829 789 830 void UISession::sltAdditionsChange() 790 831 { … … 878 919 this, SIGNAL(sigHostScreenCountChanged(int))); 879 920 921 /* Install Qt reconfiguration callbacks: */ 880 922 connect(QApplication::desktop(), SIGNAL(resized(int)), 881 this, S IGNAL(sigHostScreenFullGeometryResized(int)));923 this, SLOT(sltHandleHostScreenGeometryChange())); 882 924 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), 883 this, SIGNAL(sigHostScreenAvailableGeometryResized(int))); 925 this, SLOT(sltHandleHostScreenGeometryChange())); 926 927 #ifdef Q_WS_MAC 928 /* Install display reconfiguration callback: */ 929 CGDisplayRegisterReconfigurationCallback(cgDisplayReconfigurationCallback, this); 930 #endif /* Q_WS_MAC */ 884 931 } 885 932 … … 1015 1062 /* Destroy console event-handler: */ 1016 1063 UIConsoleEventHandler::destroy(); 1064 } 1065 1066 void UISession::cleanupConnections() 1067 { 1068 #ifdef Q_WS_MAC 1069 /* Remove display reconfiguration callback: */ 1070 CGDisplayRemoveReconfigurationCallback(cgDisplayReconfigurationCallback, this); 1071 #endif /* Q_WS_MAC */ 1017 1072 } 1018 1073 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r48920 r49013 158 158 void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; } 159 159 void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled) { m_fIsAutoCaptureDisabled = fIsAutoCaptureDisabled; } 160 void forgetPreviousMachineState() { m_machineStatePrevious = m_machineState; } 160 161 161 162 /* Keyboard setters: */ … … 207 208 void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 208 209 209 /* Qt callback signal: */210 /* Notifiers: Qt callback stuff: */ 210 211 void sigHostScreenCountChanged(int cHostScreenCount); 211 void sigHostScreenFullGeometryResized(int iHostScreenNumber); 212 void sigHostScreenAvailableGeometryResized(int iHostScreenNumber); 212 void sigHostScreenGeometryChanged(); 213 213 214 214 /* Session signals: */ … … 234 234 void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo); 235 235 236 /* Handler: Host callback stuff: */ 237 void sltHandleHostScreenGeometryChange(); 238 236 239 private: 237 240 … … 253 256 //void cleanupScreens() {} 254 257 void cleanupConsoleEventHandlers(); 255 //void cleanupConnections() {}258 void cleanupConnections(); 256 259 257 260 /* Update helpers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r48920 r49013 97 97 if (uisession()->isRunning() && uisession()->wasPaused()) 98 98 { 99 LogRelFlow(("UIMachineLogicFullscreen: " 100 "Machine-state changed from 'paused' to 'running': " 101 "Updating screen-layout...\n")); 102 103 /* Make sure further code will be called just once: */ 104 uisession()->forgetPreviousMachineState(); 99 105 /* We should rebuild screen-layout: */ 100 106 m_pScreenLayout->rebuild(); 101 107 /* We should update machine-windows sizes: */ 102 108 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 103 pMachineWindow->handleScreen Resize();109 pMachineWindow->handleScreenGeometryChange(); 104 110 } 105 111 } … … 119 125 void UIMachineLogicFullscreen::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo) 120 126 { 121 LogRelFlow(("UIMachineLogicFullscreen: :GuestScreenCountChanged.\n"));127 LogRelFlow(("UIMachineLogicFullscreen: Guest-screen count changed.\n")); 122 128 123 129 /* Update multi-screen layout before any window update: */ … … 132 138 void UIMachineLogicFullscreen::sltHostScreenCountChanged(int cScreenCount) 133 139 { 134 LogRelFlow(("UIMachineLogicFullscreen: :HostScreenCountChanged.\n"));140 LogRelFlow(("UIMachineLogicFullscreen: Host-screen count changed.\n")); 135 141 136 142 /* Update multi-screen layout before any window update: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r47478 r49013 29 29 #include "UIMachineLogicFullscreen.h" 30 30 #include "UIMachineWindowFullscreen.h" 31 #include "UIMachineView.h" 31 32 #include "UIMachineDefs.h" 32 33 #include "UIMiniToolBar.h" … … 164 165 /* Resize to the appropriate size: */ 165 166 resize(workingArea.size()); 167 /* Adjust guest if necessary: */ 168 machineView()->normalizeGeometry(false); 166 169 /* Move mini-toolbar into appropriate place: */ 167 170 if (m_pMiniToolBar) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r48920 r49013 109 109 if (uisession()->isRunning() && uisession()->wasPaused()) 110 110 { 111 LogRelFlow(("UIMachineLogicSeamless: " 112 "Machine-state changed from 'paused' to 'running': " 113 "Updating screen-layout...\n")); 114 115 /* Make sure further code will be called just once: */ 116 uisession()->forgetPreviousMachineState(); 111 117 /* We should rebuild screen-layout: */ 112 118 m_pScreenLayout->rebuild(); 113 119 /* We should update machine-windows sizes: */ 114 120 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 115 pMachineWindow->handleScreen Resize();121 pMachineWindow->handleScreenGeometryChange(); 116 122 } 117 123 } … … 119 125 void UIMachineLogicSeamless::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo) 120 126 { 121 LogRelFlow(("UIMachineLogicSeamless: :GuestScreenCountChanged.\n"));127 LogRelFlow(("UIMachineLogicSeamless: Guest-screen count changed.\n")); 122 128 123 129 /* Update multi-screen layout before any window update: */ … … 132 138 void UIMachineLogicSeamless::sltHostScreenCountChanged(int cScreenCount) 133 139 { 134 LogRelFlow(("UIMachineLogicSeamless: :HostScreenCountChanged.\n"));140 LogRelFlow(("UIMachineLogicSeamless: Host-screen count changed.\n")); 135 141 136 142 /* Update multi-screen layout before any window update: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r48705 r49013 29 29 #include "UIMachineLogicSeamless.h" 30 30 #include "UIMachineWindowSeamless.h" 31 #include "UIMachineView Seamless.h"31 #include "UIMachineView.h" 32 32 #ifndef Q_WS_MAC 33 33 # include "UIMachineDefs.h" … … 197 197 /* Resize to the appropriate size: */ 198 198 resize(workingArea.size()); 199 /* Adjust guest if necessary: */ 200 machineView()->normalizeGeometry(false); 199 201 #ifndef Q_WS_MAC 200 202 /* Move mini-toolbar into appropriate place: */
Note:
See TracChangeset
for help on using the changeset viewer.