Changeset 98547 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 13, 2023 1:46:34 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155826
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r98520 r98547 925 925 QApplication::translate("UIMessageCenter", "Failed to change NAT network parameter.") + 926 926 UIErrorString::formatErrorInfo(comNetwork)); 927 } 928 929 /* static */ 930 void UINotificationMessage::cannotChangeDisplayParameter(const CDisplay &comDisplay) 931 { 932 createMessage( 933 QApplication::translate("UIMessageCenter", "Display failure ..."), 934 QApplication::translate("UIMessageCenter", "Failed to change display parameter.") + 935 UIErrorString::formatErrorInfo(comDisplay)); 927 936 } 928 937 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r98520 r98547 320 320 * @param comNetwork Brings the object parameter get acquired from. */ 321 321 static void cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork); 322 /** Notifies about inability to acquire I NATNetworkparameter.323 * @param com NetworkBrings the object parameter get acquired from. */322 /** Notifies about inability to acquire IDisplay parameter. 323 * @param comDisplay Brings the object parameter get acquired from. */ 324 324 static void cannotAcquireDisplayParameter(const CDisplay &comDisplay); 325 325 /** Notifies about inability to acquire IUpdateAgent parameter. … … 384 384 * @param comNetwork Brings the object parameter being changed for. */ 385 385 static void cannotChangeNATNetworkParameter(const CNATNetwork &comNetwork); 386 /** Notifies about inability to change IDisplay parameter. 387 * @param comDisplay Brings the object parameter being changed for. */ 388 static void cannotChangeDisplayParameter(const CDisplay &comDisplay); 386 389 /** Notifies about inability to change ICloudProfile parameter. 387 390 * @param comProfile Brings the object parameter being changed for. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98520 r98547 436 436 uWidth, uHeight, uBitsPerPixel, 437 437 xOrigin, yOrigin, enmMonitorStatus); 438 } 439 440 bool UIMachine::setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin, 441 long xOrigin, long yOrigin, ulong uWidth, ulong uHeight, 442 ulong uBitsPerPixel, bool fNotify) 443 { 444 return uisession()->setVideoModeHint(uScreenId, fEnabled, fChangeOrigin, 445 xOrigin, yOrigin, uWidth, uHeight, 446 uBitsPerPixel, fNotify); 447 } 448 449 bool UIMachine::acquireVideoModeHint(ulong uScreenId, bool &fEnabled, bool &fChangeOrigin, 450 long &xOrigin, long &yOrigin, ulong &uWidth, ulong &uHeight, 451 ulong &uBitsPerPixel) 452 { 453 return uisession()->acquireVideoModeHint(uScreenId, fEnabled, fChangeOrigin, 454 xOrigin, yOrigin, uWidth, uHeight, 455 uBitsPerPixel); 438 456 } 439 457 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98520 r98547 281 281 ulong &uWidth, ulong &uHeight, ulong &uBitsPerPixel, 282 282 long &xOrigin, long &yOrigin, KGuestMonitorStatus &enmMonitorStatus); 283 /** Defines video mode hint for guest-screen with passed uScreenId. */ 284 bool setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin, 285 long xOrigin, long yOrigin, ulong uWidth, ulong uHeight, 286 ulong uBitsPerPixel, bool fNotify); 287 /** Acquires video mode hint for guest-screen with passed uScreenId. */ 288 bool acquireVideoModeHint(ulong uScreenId, bool &fEnabled, bool &fChangeOrigin, 289 long &xOrigin, long &yOrigin, ulong &uWidth, ulong &uHeight, 290 ulong &uBitsPerPixel); 283 291 /** @} */ 284 292 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98520 r98547 796 796 LogRel(("GUI: UIMachineView::sltPerformGuestResize: Auto-pilot resizing screen %d as %dx%d\n", 797 797 (int)screenId(), size.width(), size.height())); 798 display().SetVideoModeHint(screenId(), 799 uimachine()->isScreenVisible(screenId()), 800 false /* change origin? */, 801 0 /* origin x */, 802 0 /* origin y */, 803 size.width(), 804 size.height(), 805 0 /* bits per pixel */, 806 true /* notify? */); 798 uimachine()->setVideoModeHint(screenId(), 799 uimachine()->isScreenVisible(screenId()), 800 false /* change origin? */, 801 0 /* origin x */, 0 /* origin y */, 802 size.width(), size.height(), 803 0 /* bits per pixel */, 804 true /* notify? */); 807 805 } 808 806 } … … 814 812 /* Send enabling size-hint to the guest: */ 815 813 LogRel(("GUI: UIMachineView::sltPerformGuestResize: Auto-pilot enabling guest-screen %d\n", (int)screenId())); 816 display().SetVideoModeHint(screenId(), 817 true /* enabled? */, 818 false /* change origin? */, 819 0 /* origin x */, 820 0 /* origin y */, 821 size.width(), 822 size.height(), 823 0 /* bits per pixel */, 824 true /* notify? */); 814 uimachine()->setVideoModeHint(screenId(), 815 true /* enabled? */, 816 false /* change origin? */, 817 0 /* origin x */, 0 /* origin y */, 818 size.width(), size.height(), 819 0 /* bits per pixel */, 820 true /* notify? */); 825 821 } 826 822 /* If host desires to have guest-screen disabled and guest-screen is enabled, retrying: */ … … 829 825 /* Send disabling size-hint to the guest: */ 830 826 LogRel(("GUI: UIMachineView::sltPerformGuestResize: Auto-pilot disabling guest-screen %d\n", (int)screenId())); 831 display().SetVideoModeHint(screenId(), 832 false /* enabled? */, 833 false /* change origin? */, 834 0 /* origin x */, 835 0 /* origin y */, 836 0 /* width */, 837 0 /* height */, 838 0 /* bits per pixel */, 839 true /* notify? */); 827 uimachine()->setVideoModeHint(screenId(), 828 false /* enabled? */, 829 false /* change origin? */, 830 0 /* origin x */, 0 /* origin y */, 831 0 /* width */, 0 /* height */, 832 0 /* bits per pixel */, 833 true /* notify? */); 840 834 } 841 835 } … … 864 858 LogRel(("GUI: UIMachineView::sltPerformGuestResize: Sending guest size-hint to screen %d as %dx%d\n", 865 859 (int)screenId(), size.width(), size.height())); 866 display().SetVideoModeHint(screenId(), 867 uimachine()->isScreenVisible(screenId()), 868 false /* change origin? */, 869 0 /* origin x */, 870 0 /* origin y */, 871 size.width(), 872 size.height(), 873 0 /* bits per pixel */, 874 true /* notify? */); 860 uimachine()->setVideoModeHint(screenId(), 861 uimachine()->isScreenVisible(screenId()), 862 false /* change origin? */, 863 0 /* origin x */, 0 /* origin y */, 864 size.width(), size.height(), 865 0 /* bits per pixel */, 866 true /* notify? */); 875 867 m_lastSizeHint = size; 876 868 } … … 920 912 /* Send enabling size-hint to the guest: */ 921 913 LogRel(("GUI: UIMachineView::sltHandleActionTriggerViewScreenToggle: Enabling guest-screen %d\n", (int)screenId())); 922 display().SetVideoModeHint(screenId(), 923 true /* enabled? */, 924 false /* change origin? */, 925 0 /* origin x */, 926 0 /* origin y */, 927 uWidth, 928 uHeight, 929 0 /* bits per pixel */, 930 true /* notify? */); 914 uimachine()->setVideoModeHint(screenId(), 915 true /* enabled? */, 916 false /* change origin? */, 917 0 /* origin x */, 0 /* origin y */, 918 uWidth, uHeight, 919 0 /* bits per pixel */, 920 true /* notify? */); 931 921 } 932 922 else … … 934 924 /* Send disabling size-hint to the guest: */ 935 925 LogRel(("GUI: UIMachineView::sltHandleActionTriggerViewScreenToggle: Disabling guest-screen %d\n", (int)screenId())); 936 display().SetVideoModeHint(screenId(), 937 false /* enabled? */, 938 false /* change origin? */, 939 0 /* origin x */, 940 0 /* origin y */, 941 0 /* width */, 942 0 /* height */, 943 0 /* bits per pixel */, 944 true /* notify? */); 926 uimachine()->setVideoModeHint(screenId(), 927 false /* enabled? */, 928 false /* change origin? */, 929 0 /* origin x */, 0 /* origin y */, 930 0 /* width */, 0 /* height */, 931 0 /* bits per pixel */, 932 true /* notify? */); 945 933 } 946 934 } … … 971 959 /* Send enabling size-hint to the guest: */ 972 960 LogRel(("GUI: UIMachineView::sltHandleActionTriggerViewScreenResize: Resizing guest-screen %d\n", (int)screenId())); 973 display().SetVideoModeHint(screenId(), 974 true /* enabled? */, 975 false /* change origin? */, 976 0 /* origin x */, 977 0 /* origin y */, 978 size.width(), 979 size.height(), 980 0 /* bits per pixel */, 981 true /* notify? */); 961 uimachine()->setVideoModeHint(screenId(), 962 true /* enabled? */, 963 false /* change origin? */, 964 0 /* origin x */, 0 /* origin y */, 965 size.width(), size.height(), 966 0 /* bits per pixel */, 967 true /* notify? */); 982 968 } 983 969 … … 1517 1503 { 1518 1504 /* Acquire last guest-screen size-hint set, if any: */ 1519 BOOL fEnabled, fChangeOrigin; 1520 LONG iOriginX, iOriginY; 1521 ULONG uWidth, uHeight, uBitsPerPixel; 1522 display().GetVideoModeHint(screenId(), fEnabled, fChangeOrigin, 1523 iOriginX, iOriginY, uWidth, uHeight, uBitsPerPixel); 1505 bool fDummy = false; 1506 long iDummy = 0; 1507 ulong uWidth = 0, uHeight = 0, uDummy = 0; 1508 uimachine()->acquireVideoModeHint(screenId(), fDummy, fDummy, 1509 iDummy, iDummy, uWidth, uHeight, 1510 uDummy); 1524 1511 1525 1512 /* Acquire effective frame-buffer size otherwise: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r98520 r98547 38 38 /* COM includes: */ 39 39 #include "COMEnums.h" 40 #include "CDisplay.h"41 40 #include "CMachine.h" 42 41 #include "CGraphicsAdapter.h" … … 142 141 LogRel(("GUI: UIMultiScreenLayout::update: Disabling excessive guest-screen %d\n", iGuestScreen)); 143 142 uimachine()->setScreenVisibleHostDesires(iGuestScreen, false); 144 machineLogic()->display().SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0, true); 143 uimachine()->setVideoModeHint(iGuestScreen, 144 false /* enabled? */, 145 false /* change origin? */, 146 0 /* origin x */, 0 /* origin y */, 147 0 /* width */, 0 /* height*/, 148 0 /* bits per pixel */, 149 true /* notify? */); 145 150 } 146 151 } … … 174 179 iGuestScreen, uWidth, uHeight)); 175 180 uimachine()->setScreenVisibleHostDesires(iGuestScreen, true); 176 machineLogic()->display().SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32, true); 181 uimachine()->setVideoModeHint(iGuestScreen, 182 true/* enabled? */, 183 false /* change origin? */, 184 0 /* origin x */, 0 /* origin y */, 185 uWidth, uHeight, 186 32/* bits per pixel */, 187 true /* notify? */); 177 188 } 178 189 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98520 r98547 416 416 yOrigin = iGuestYOrigin; 417 417 enmMonitorStatus = enmGuestMonitorStatus; 418 return fSuccess; 419 } 420 421 bool UISession::setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin, long xOrigin, long yOrigin, 422 ulong uWidth, ulong uHeight, ulong uBitsPerPixel, bool fNotify) 423 { 424 CDisplay comDisplay = display(); 425 comDisplay.SetVideoModeHint(uScreenId, fEnabled, fChangeOrigin, xOrigin, yOrigin, 426 uWidth, uHeight, uBitsPerPixel, fNotify); 427 const bool fSuccess = comDisplay.isOk(); 428 if (!fSuccess) 429 UINotificationMessage::cannotChangeDisplayParameter(comDisplay); 430 return fSuccess; 431 } 432 433 bool UISession::acquireVideoModeHint(ulong uScreenId, bool &fEnabled, bool &fChangeOrigin, 434 long &xOrigin, long &yOrigin, ulong &uWidth, ulong &uHeight, 435 ulong &uBitsPerPixel) 436 { 437 CDisplay comDisplay = display(); 438 BOOL fGuestEnabled = false, fGuestChangeOrigin = false; 439 LONG iGuestXOrigin = 0, iGuestYOrigin = 0; 440 ULONG uGuestWidth = 0, uGuestHeight = 0, uGuestBitsPerPixel = 0; 441 comDisplay.GetVideoModeHint(uScreenId, fGuestEnabled, fGuestChangeOrigin, 442 iGuestXOrigin, iGuestYOrigin, uGuestWidth, uGuestHeight, 443 uGuestBitsPerPixel); 444 const bool fSuccess = comDisplay.isOk(); 445 if (!fSuccess) 446 UINotificationMessage::cannotAcquireDisplayParameter(comDisplay); 447 fEnabled = fGuestEnabled; 448 fChangeOrigin = fGuestChangeOrigin; 449 xOrigin = iGuestXOrigin; 450 yOrigin = iGuestYOrigin; 451 uWidth = uGuestWidth; 452 uHeight = uGuestHeight; 453 uBitsPerPixel = uGuestBitsPerPixel; 418 454 return fSuccess; 419 455 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98520 r98547 299 299 ulong &uWidth, ulong &uHeight, ulong &uBitsPerPixel, 300 300 long &xOrigin, long &yOrigin, KGuestMonitorStatus &enmMonitorStatus); 301 /** Defines video mode hint for guest-screen with passed uScreenId. */ 302 bool setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin, 303 long xOrigin, long yOrigin, ulong uWidth, ulong uHeight, 304 ulong uBitsPerPixel, bool fNotify); 305 /** Acquires video mode hint for guest-screen with passed uScreenId. */ 306 bool acquireVideoModeHint(ulong uScreenId, bool &fEnabled, bool &fChangeOrigin, 307 long &xOrigin, long &yOrigin, ulong &uWidth, ulong &uHeight, 308 ulong &uBitsPerPixel); 301 309 /** @} */ 302 310 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r98450 r98547 149 149 void UIMachineViewNormal::resendSizeHint() 150 150 { 151 /* Skip if VM isn't running/paused yet: */ 152 if ( !uimachine()->isRunning() 153 && !uimachine()->isPaused()) 154 return; 155 151 156 /* Skip if another visual representation mode requested: */ 152 157 if (uimachine()->requestedVisualState() == UIVisualStateType_Seamless) // Seamless only for now. … … 174 179 * guest driver which saves the video mode to the registry on shutdown. */ 175 180 uimachine()->setScreenVisibleHostDesires(screenId(), guestScreenVisibilityStatus()); 176 display().SetVideoModeHint(screenId(), 177 guestScreenVisibilityStatus(), 178 false, 0, 0, effectiveSizeHint.width(), effectiveSizeHint.height(), 0, false); 181 uimachine()->setVideoModeHint(screenId(), 182 guestScreenVisibilityStatus(), 183 false /* change origin? */, 184 0 /* origin x */, 0 /* origin y */, 185 effectiveSizeHint.width(), effectiveSizeHint.height(), 186 0 /* bits per pixel */, 187 false /* notify? */); 179 188 } 180 189 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r98419 r98547 41 41 42 42 /* COM includes: */ 43 #include "CConsole.h"44 43 #include "CDisplay.h" 45 44 #include "CGraphicsAdapter.h" … … 166 165 void UIMachineViewScale::resendSizeHint() 167 166 { 167 /* Skip if VM isn't running/paused yet: */ 168 if ( !uimachine()->isRunning() 169 && !uimachine()->isPaused()) 170 return; 171 168 172 /* Get the last guest-screen size-hint, taking the scale factor into account. */ 169 173 const QSize sizeHint = scaledBackward(storedGuestScreenSizeHint()); … … 176 180 /* Send saved size-hint to the guest: */ 177 181 uimachine()->setScreenVisibleHostDesires(screenId(), guestScreenVisibilityStatus()); 178 display().SetVideoModeHint(screenId(), 179 guestScreenVisibilityStatus(), 180 false, 0, 0, sizeHint.width(), sizeHint.height(), 0, true); 182 uimachine()->setVideoModeHint(screenId(), 183 guestScreenVisibilityStatus(), 184 false /* change origin? */, 185 0 /* origin x */, 0 /* origin y */, 186 sizeHint.width(), sizeHint.height(), 187 0 /* bits per pixel */, 188 true /* notify? */); 181 189 } 182 190
Note:
See TracChangeset
for help on using the changeset viewer.