Changeset 7512 in vbox
- Timestamp:
- Mar 20, 2008 7:01:47 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
r7463 r7512 196 196 private: 197 197 198 void setDesktopGeometry(int minWidth, int minHeight); 198 199 void sendInitialSizeHint(void); 199 200 void maybeRestrictMinimumSize(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r7483 r7512 755 755 /* Remember the desktop geometry and register for geometry change 756 756 events for telling the guest about video modes we like. */ 757 mDesktopGeometry = QApplication::desktop()->screenGeometry (this); 757 758 doResizeDesktop(0); 758 759 connect (QApplication::desktop(), SIGNAL(workAreaResized(int)), 759 760 this, SLOT(doResizeDesktop(int))); … … 3598 3599 LogFlowFunc (("Will suggest %d x %d\n", sz.width(), sz.height())); 3599 3600 3601 /* Increase the desktop geometry if needed */ 3602 setDesktopGeometry(sz.width(), sz.height()); 3603 3600 3604 mConsole.GetDisplay().SetVideoModeHint (sz.width(), sz.height(), 0, 0); 3601 3605 } … … 3604 3608 void VBoxConsoleView::doResizeDesktop (int) 3605 3609 { 3606 mDesktopGeometry = QApplication::desktop()->screenGeometry (this); 3607 } 3610 setDesktopGeometry(0, 0); 3611 } 3612 3613 /** 3614 * Set the maximum size allowed for the guest desktop to the available area 3615 * minus 100 pixels each way, or to the specified minimum width and height, 3616 * whichever is greater. 3617 * 3618 * @param minWidth The width that the guest screen should at least be 3619 * allowed to increase to 3620 * @param minHeight The height that the guest screen should at least be 3621 * allowed to increase to 3622 */ 3623 void VBoxConsoleView::setDesktopGeometry(int minWidth, int minHeight) 3624 { 3625 LogFlowThisFunc(("minWidth=%d, minHeight=%d\n", minWidth, minHeight)); 3626 QRect desktopGeometry = QApplication::desktop()->screenGeometry (this); 3627 int width = desktopGeometry.width(); 3628 if (width - 100 < minWidth) 3629 width = minWidth; 3630 else 3631 width = width - 100; 3632 int height = desktopGeometry.height(); 3633 if (height - 100 < minHeight) 3634 height = minHeight; 3635 else 3636 height = height - 100; 3637 LogFlowThisFunc(("Setting %d, %d\n", width, height)); 3638 mDesktopGeometry = QRect(0, 0, width, height); 3639 } 3640 3608 3641 3609 3642 /** -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp
r7482 r7512 194 194 ULONG aBPP, BOOL *aSupported) 195 195 { 196 LogFlowThisFunc(("aWidth=%lu, aHeight=%lu, aBPP=%lu\n", 197 (unsigned long) aWidth, (unsigned long) aHeight, 198 (unsigned long) aBPP)); 196 199 if (!aSupported) 197 200 return E_POINTER; 198 201 *aSupported = TRUE; 199 202 QRect screen = mView->getDesktopGeometry(); 200 /* Leave 200 pixels leeway. */201 203 if (aWidth > (ULONG) screen.width()) 202 204 *aSupported = FALSE; … … 205 207 if (aBPP != 32) 206 208 *aSupported = FALSE; 209 LogFlowThisFunc(("returning aSupported=%d\n", *aSupported)); 207 210 return S_OK; 208 211 } -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h
r7463 r7512 192 192 private: 193 193 194 void setDesktopGeometry(int minWidth, int minHeight); 194 195 void sendInitialSizeHint(void); 195 196 void maybeRestrictMinimumSize(); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r7483 r7512 751 751 /* Remember the desktop geometry and register for geometry change 752 752 events for telling the guest about video modes we like. */ 753 mDesktopGeometry = QApplication::desktop()->screenGeometry (this); 753 754 doResizeDesktop(0); 754 755 connect (QApplication::desktop(), SIGNAL(workAreaResized(int)), 755 756 this, SLOT(doResizeDesktop(int))); … … 3592 3593 LogFlowFunc (("Will suggest %d x %d\n", sz.width(), sz.height())); 3593 3594 3595 /* Increase the desktop geometry if needed */ 3596 setDesktopGeometry(sz.width(), sz.height()); 3597 3594 3598 mConsole.GetDisplay().SetVideoModeHint (sz.width(), sz.height(), 0, 0); 3595 3599 } … … 3598 3602 void VBoxConsoleView::doResizeDesktop (int) 3599 3603 { 3600 mDesktopGeometry = QApplication::desktop()->screenGeometry (this);3604 setDesktopGeometry(0, 0); 3601 3605 } 3602 3606 3607 /** 3608 * Set the maximum size allowed for the guest desktop to the available area 3609 * minus 100 pixels each way, or to the specified minimum width and height, 3610 * whichever is greater. 3611 * 3612 * @param minWidth The width that the guest screen should at least be 3613 * allowed to increase to 3614 * @param minHeight The height that the guest screen should at least be 3615 * allowed to increase to 3616 */ 3617 void VBoxConsoleView::setDesktopGeometry(int minWidth, int minHeight) 3618 { 3619 LogFlowThisFunc(("minWidth=%d, minHeight=%d\n", minWidth, minHeight)); 3620 QRect desktopGeometry = QApplication::desktop()->screenGeometry (this); 3621 int width = desktopGeometry.width(); 3622 if (width - 100 < minWidth) 3623 width = minWidth; 3624 else 3625 width = width - 100; 3626 int height = desktopGeometry.height(); 3627 if (height - 100 < minHeight) 3628 height = minHeight; 3629 else 3630 height = height - 100; 3631 LogFlowThisFunc(("Setting %d, %d\n", width, height)); 3632 mDesktopGeometry = QRect(0, 0, width, height); 3633 } 3634 3635 3603 3636 /** 3604 3637 * We send an initial size hint to the VM on startup, based on the last -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFrameBuffer.cpp
r7463 r7512 195 195 ULONG aBPP, BOOL *aSupported) 196 196 { 197 LogFlowThisFunc(("aWidth=%lu, aHeight=%lu, aBPP=%lu\n", 198 (unsigned long) aWidth, (unsigned long) aHeight, 199 (unsigned long) aBPP)); 197 200 if (!aSupported) 198 201 return E_POINTER; … … 205 208 if (aBPP != 32) 206 209 *aSupported = FALSE; 210 LogFlowThisFunc(("returning aSupported=%d\n", *aSupported)); 207 211 return S_OK; 208 212 }
Note:
See TracChangeset
for help on using the changeset viewer.