Changeset 57285 in vbox
- Timestamp:
- Aug 12, 2015 11:28:54 AM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r57178 r57285 648 648 { 649 649 /* Update action states: */ 650 LogRel3(("GUI: UIMachineLogic::sltAdditionsStateChanged: Adjusting actions availability according to GA state.\n")); 650 651 actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->setEnabled(uisession()->isGuestSupportsGraphics()); 651 652 actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(uisession()->isVisualStateAllowed(UIVisualStateType_Seamless) && 652 653 uisession()->isGuestSupportsSeamless()); 653 654 } 654 655 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r57178 r57285 890 890 m_fIsGuestSupportsSeamless = fIsGuestSupportsSeamless; 891 891 892 /* Notify listeners about guest additions state really changed: */ 892 /* Notify listeners about GA state really changed: */ 893 LogRel(("GUI: UISession::sltAdditionsChange: GA state really changed, notifying listeners.\n")); 893 894 emit sigAdditionsStateActualChange(); 894 895 } 895 896 896 /* Notify listeners about guest additions state event came: */ 897 /* Notify listeners about GA state change event came: */ 898 LogRel(("GUI: UISession::sltAdditionsChange: GA state change event came, notifying listeners.\n")); 897 899 emit sigAdditionsStateChange(); 898 900 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r54160 r57285 145 145 void UIMachineViewFullscreen::adjustGuestScreenSize() 146 146 { 147 /* Acquire working-area size: */ 148 const QSize workingAreaSize = workingArea().size(); 149 /* Acquire frame-buffer size: */ 150 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 151 /* Take the scale-factor(s) into account: */ 152 frameBufferSize = scaledForward(frameBufferSize); 153 /* Check if we should adjust guest-screen to new size: */ 154 if (frameBuffer()->isAutoEnabled() || 155 frameBufferSize != workingAreaSize) 156 if (m_bIsGuestAutoresizeEnabled && 157 uisession()->isGuestSupportsGraphics() && 158 uisession()->isScreenVisible(screenId())) 159 { 160 frameBuffer()->setAutoEnabled(false); 161 sltPerformGuestResize(workingArea().size()); 162 } 147 /* Should we adjust guest-screen size? Logging paranoia is required here to reveal the truth. */ 148 LogRel(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Adjust guest-screen size if necessary.\n")); 149 bool fAdjust = false; 150 151 /* Step 1: Was the guest-screen enabled automatically? */ 152 if (!fAdjust) 153 { 154 if (frameBuffer()->isAutoEnabled()) 155 { 156 LogRel2(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Guest-screen was enabled automatically, adjustment is required.\n")); 157 fAdjust = true; 158 } 159 } 160 /* Step 2: Is the guest-screen of another size than necessary? */ 161 if (!fAdjust) 162 { 163 /* Acquire frame-buffer size: */ 164 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 165 /* Take the scale-factor(s) into account: */ 166 frameBufferSize = scaledForward(frameBufferSize); 167 168 /* Acquire working-area size: */ 169 const QSize workingAreaSize = workingArea().size(); 170 171 if (frameBufferSize != workingAreaSize) 172 { 173 LogRel2(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Guest-screen is of another size than necessary, adjustment is required.\n")); 174 fAdjust = true; 175 } 176 } 177 178 /* Step 3: Is guest-additions supports graphics? */ 179 if (fAdjust) 180 { 181 if (!uisession()->isGuestSupportsGraphics()) 182 { 183 LogRel2(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Guest-additions are not supporting graphics, adjustment is omitted.\n")); 184 fAdjust = false; 185 } 186 } 187 /* Step 4: Is guest-screen visible? */ 188 if (fAdjust) 189 { 190 if (!uisession()->isScreenVisible(screenId())) 191 { 192 LogRel2(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Guest-screen is not visible, adjustment is omitted.\n")); 193 fAdjust = false; 194 } 195 } 196 /* Step 5: Is guest-screen auto-resize enabled? */ 197 if (fAdjust) 198 { 199 if (!m_bIsGuestAutoresizeEnabled) 200 { 201 LogRel2(("GUI: UIMachineViewFullscreen::adjustGuestScreenSize: Guest-screen auto-resize is disabled, adjustment is omitted.\n")); 202 fAdjust = false; 203 } 204 } 205 206 /* Final step: Adjust if requested/allowed. */ 207 if (fAdjust) 208 { 209 frameBuffer()->setAutoEnabled(false); 210 sltPerformGuestResize(workingArea().size()); 211 } 163 212 } 164 213 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r56704 r57285 165 165 void UIMachineViewNormal::adjustGuestScreenSize() 166 166 { 167 /* Acquire central-widget size: */ 168 const QSize centralWidgetSize = machineWindow()->centralWidget()->size(); 169 /* Acquire frame-buffer size: */ 170 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 171 /* Take the scale-factor(s) into account: */ 172 frameBufferSize = scaledForward(frameBufferSize); 173 /* Check if we should adjust guest-screen to new size: */ 174 if (frameBufferSize != centralWidgetSize) 175 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics()) 176 sltPerformGuestResize(centralWidgetSize); 167 /* Should we adjust guest-screen size? Logging paranoia is required here to reveal the truth. */ 168 LogRel(("GUI: UIMachineViewNormal::adjustGuestScreenSize: Adjust guest-screen size if necessary.\n")); 169 bool fAdjust = false; 170 171 /* Step 1: Is the guest-screen of another size than necessary? */ 172 if (!fAdjust) 173 { 174 /* Acquire frame-buffer size: */ 175 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 176 /* Take the scale-factor(s) into account: */ 177 frameBufferSize = scaledForward(frameBufferSize); 178 179 /* Acquire central-widget size: */ 180 const QSize centralWidgetSize = machineWindow()->centralWidget()->size(); 181 182 if (frameBufferSize != centralWidgetSize) 183 { 184 LogRel2(("GUI: UIMachineViewNormal::adjustGuestScreenSize: Guest-screen is of another size than necessary, adjustment is required.\n")); 185 fAdjust = true; 186 } 187 } 188 189 /* Step 2: Is guest-additions supports graphics? */ 190 if (fAdjust) 191 { 192 if (!uisession()->isGuestSupportsGraphics()) 193 { 194 LogRel2(("GUI: UIMachineViewNormal::adjustGuestScreenSize: Guest-additions are not supporting graphics, adjustment is omitted.\n")); 195 fAdjust = false; 196 } 197 } 198 /* Step 3: Is guest-screen visible? */ 199 if (fAdjust) 200 { 201 if (!uisession()->isScreenVisible(screenId())) 202 { 203 LogRel2(("GUI: UIMachineViewNormal::adjustGuestScreenSize: Guest-screen is not visible, adjustment is omitted.\n")); 204 fAdjust = false; 205 } 206 } 207 /* Step 4: Is guest-screen auto-resize enabled? */ 208 if (fAdjust) 209 { 210 if (!m_bIsGuestAutoresizeEnabled) 211 { 212 LogRel2(("GUI: UIMachineViewNormal::adjustGuestScreenSize: Guest-screen auto-resize is disabled, adjustment is omitted.\n")); 213 fAdjust = false; 214 } 215 } 216 217 /* Final step: Adjust if requested/allowed. */ 218 if (fAdjust) 219 { 220 sltPerformGuestResize(machineWindow()->centralWidget()->size()); 221 } 177 222 } 178 223 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r54160 r57285 162 162 void UIMachineViewSeamless::adjustGuestScreenSize() 163 163 { 164 /* Acquire working-area size: */ 165 const QSize workingAreaSize = workingArea().size(); 166 /* Acquire frame-buffer size: */ 167 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 168 /* Take the scale-factor(s) into account: */ 169 frameBufferSize = scaledForward(frameBufferSize); 170 /* Check if we should adjust guest-screen to new size: */ 171 if (frameBuffer()->isAutoEnabled() || 172 frameBufferSize != workingAreaSize) 173 if (uisession()->isGuestSupportsGraphics() && 174 uisession()->isScreenVisible(screenId())) 175 { 176 frameBuffer()->setAutoEnabled(false); 177 sltPerformGuestResize(workingArea().size()); 178 } 164 /* Should we adjust guest-screen size? Logging paranoia is required here to reveal the truth. */ 165 LogRel(("GUI: UIMachineViewSeamless::adjustGuestScreenSize: Adjust guest-screen size if necessary.\n")); 166 bool fAdjust = false; 167 168 /* Step 1: Was the guest-screen enabled automatically? */ 169 if (!fAdjust) 170 { 171 if (frameBuffer()->isAutoEnabled()) 172 { 173 LogRel2(("GUI: UIMachineViewSeamless::adjustGuestScreenSize: Guest-screen was enabled automatically, adjustment is required.\n")); 174 fAdjust = true; 175 } 176 } 177 /* Step 2: Is the guest-screen of another size than necessary? */ 178 if (!fAdjust) 179 { 180 /* Acquire frame-buffer size: */ 181 QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height()); 182 /* Take the scale-factor(s) into account: */ 183 frameBufferSize = scaledForward(frameBufferSize); 184 185 /* Acquire working-area size: */ 186 const QSize workingAreaSize = workingArea().size(); 187 188 if (frameBufferSize != workingAreaSize) 189 { 190 LogRel2(("GUI: UIMachineViewSeamless::adjustGuestScreenSize: Guest-screen is of another size than necessary, adjustment is required.\n")); 191 fAdjust = true; 192 } 193 } 194 195 /* Step 3: Is guest-additions supports graphics? */ 196 if (fAdjust) 197 { 198 if (!uisession()->isGuestSupportsGraphics()) 199 { 200 LogRel2(("GUI: UIMachineViewSeamless::adjustGuestScreenSize: Guest-additions are not supporting graphics, adjustment is omitted.\n")); 201 fAdjust = false; 202 } 203 } 204 /* Step 4: Is guest-screen visible? */ 205 if (fAdjust) 206 { 207 if (!uisession()->isScreenVisible(screenId())) 208 { 209 LogRel2(("GUI: UIMachineViewSeamless::adjustGuestScreenSize: Guest-screen is not visible, adjustment is omitted.\n")); 210 fAdjust = false; 211 } 212 } 213 214 /* Final step: Adjust if requested/allowed. */ 215 if (fAdjust) 216 { 217 frameBuffer()->setAutoEnabled(false); 218 sltPerformGuestResize(workingArea().size()); 219 } 179 220 } 180 221
Note:
See TracChangeset
for help on using the changeset viewer.