Changeset 97674 in vbox for trunk/src/VBox
- Timestamp:
- Nov 24, 2022 11:50:41 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154729
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r96808 r97674 657 657 const int db = frGeo.bottom() - geo.bottom(); 658 658 659 /* Get the best size w/o scroll-bars: */ 659 660 if (fResizeToGuestDisplay) 660 661 { 661 /* Get the best size w/o scroll-bars: */662 /* Get widget size-hint: */ 662 663 QSize sh = sizeHint(); 663 664 664 665 /* If guest-screen auto-resize is not enabled 665 * or the guest-additions doesn't support graphics 666 * we should take scroll-bars size-hints into account: */ 667 if (!machineView()->isGuestAutoresizeEnabled() || !uisession()->isGuestSupportsGraphics()) 666 * or guest-additions doesn't support graphics 667 * we should deduce widget's size-hint on visible scroll-bar's hint: */ 668 if ( !machineView()->isGuestAutoresizeEnabled() 669 || !uisession()->isGuestSupportsGraphics()) 668 670 { 669 671 if (machineView()->verticalScrollBar()->isVisible()) … … 679 681 } 680 682 681 /* Adjust position if necessary: */ 682 if (fAdjustPosition) 683 frGeo = UIDesktopWidgetWatchdog::normalizeGeometry(frGeo, gpDesktop->overallAvailableRegion()); 683 /* Adjust size/position if necessary: */ 684 QRect frGeoNew = fAdjustPosition 685 ? UIDesktopWidgetWatchdog::normalizeGeometry(frGeo, gpDesktop->overallAvailableRegion()) 686 : frGeo; 687 688 /* If guest-screen auto-resize is not enabled 689 * or the guest-additions doesn't support graphics 690 * we should take scroll-bars size-hints into account: */ 691 if ( frGeoNew != frGeo 692 && ( !machineView()->isGuestAutoresizeEnabled() 693 || !uisession()->isGuestSupportsGraphics())) 694 { 695 /* Determine whether we need additional space for one or both scroll-bars: */ 696 QSize addition; 697 if (frGeoNew.height() < frGeo.height()) 698 addition += QSize(machineView()->verticalScrollBar()->sizeHint().width() + 1, 0); 699 if (frGeoNew.width() < frGeo.width()) 700 addition += QSize(0, machineView()->horizontalScrollBar()->sizeHint().height() + 1); 701 702 /* Resize the frame to fit the contents: */ 703 frGeoNew.setRight(frGeoNew.right() + addition.width()); 704 frGeoNew.setBottom(frGeoNew.bottom() + addition.height()); 705 706 /* Adjust size/position again: */ 707 frGeoNew = UIDesktopWidgetWatchdog::normalizeGeometry(frGeoNew, gpDesktop->overallAvailableRegion()); 708 } 684 709 685 710 /* Finally, set the frame geometry: */ 686 UIDesktopWidgetWatchdog::setTopLevelGeometry(this, frGeo.left() + dl, frGeo.top() + dt, 687 frGeo.width() - dl - dr, frGeo.height() - dt - db); 711 UIDesktopWidgetWatchdog::setTopLevelGeometry(this, 712 frGeoNew.left() + dl, frGeoNew.top() + dt, 713 frGeoNew.width() - dl - dr, frGeoNew.height() - dt - db); 688 714 #else /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */ 689 715 /* Customer request: There should no be
Note:
See TracChangeset
for help on using the changeset viewer.