- Timestamp:
- Nov 25, 2009 5:03:25 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
r24488 r24971 259 259 260 260 void setDesktopGeometry (DesktopGeo aGeo, int aWidth, int aHeight); 261 void s etDesktopGeoHint(int aWidth, int aHeight);261 void storeConsoleSize (int aWidth, int aHeight); 262 262 void calculateDesktopGeometry(); 263 263 void maybeRestrictMinimumSize(); … … 365 365 DesktopGeo mDesktopGeo; 366 366 QRect mDesktopGeometry; 367 QRect m LastSizeHint;367 QRect mStoredConsoleSize; 368 368 bool mPassCAD; 369 369 bool mHideHostPointer; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r24771 r24971 1272 1272 LogFlow (("VBoxDefs::ResizeEventType: %d x %d x %d bpp\n", 1273 1273 re->width(), re->height(), re->bitsPerPixel())); 1274 1274 #ifdef DEBUG_michael 1275 LogRel (("Resize event from guest: %d x %d x %d bpp\n", 1276 re->width(), re->height(), re->bitsPerPixel())); 1277 #endif 1278 1279 /* Store the new size to prevent unwanted resize hints being 1280 * sent back. */ 1281 storeConsoleSize(re->width(), re->height()); 1275 1282 /* do frame buffer dependent resize */ 1276 1283 … … 1354 1361 { 1355 1362 mIgnoreFrameBufferResize = false; 1356 doResizeHint (mNormalSize);1357 1363 } 1358 1364 … … 2693 2699 case DesktopGeo_Automatic: 2694 2700 rc = QRect (0, 0, 2695 RT_MAX (mDesktopGeometry.width(), m LastSizeHint.width()),2696 RT_MAX (mDesktopGeometry.height(), m LastSizeHint.height()));2701 RT_MAX (mDesktopGeometry.width(), mStoredConsoleSize.width()), 2702 RT_MAX (mDesktopGeometry.height(), mStoredConsoleSize.height())); 2697 2703 break; 2698 2704 case DesktopGeo_Any: … … 4017 4023 if (!aToSize.isValid()) 4018 4024 sz -= QSize (frameWidth() * 2, frameWidth() * 2); 4025 /* Do not send out useless hints. */ 4026 if ((sz.width() == mStoredConsoleSize.width()) && 4027 (sz.height() == mStoredConsoleSize.height())) 4028 return; 4019 4029 /* We only actually send the hint if 4020 4030 * 1) the autoresize property is set to true and … … 4029 4039 LogFlowFunc (("Will suggest %d x %d\n", sz.width(), sz.height())); 4030 4040 4031 /* Increase the maximum allowed size to the new size if needed. */4032 s etDesktopGeoHint(sz.width(), sz.height());4041 /* Remember the new size. */ 4042 storeConsoleSize (sz.width(), sz.height()); 4033 4043 4034 4044 mConsole.GetDisplay().SetVideoModeHint (sz.width(), sz.height(), 0, 0); … … 4047 4057 4048 4058 /** 4049 * Remember a geometry hint sent by the console window. This is used to 4050 * determine the maximum supported guest resolution in the @a desktopGeometry 4051 * method. A hint will always override other restrictions. 4059 * Store the current size of the console (i.e. the viewport to the guest). 4060 * This has two purposes. One is to suppress unwanted resize events for 4061 * which the new size is the same as the stored size. The other is to expand 4062 * the maximum size to which we will let the guest resize itself. It makes 4063 * no sense to forbid guest resizes which are less than the current resolution 4064 * anyway. 4052 4065 * 4053 4066 * @param aWidth width of the resolution hint 4054 4067 * @param aHeight height of the resolution hint 4055 4068 */ 4056 void VBoxConsoleView::s etDesktopGeoHint(int aWidth, int aHeight)4069 void VBoxConsoleView::storeConsoleSize (int aWidth, int aHeight) 4057 4070 { 4058 4071 LogFlowThisFunc (("aWidth=%d, aHeight=%d\n", aWidth, aHeight)); 4059 m LastSizeHint= QRect (0, 0, aWidth, aHeight);4072 mStoredConsoleSize = QRect (0, 0, aWidth, aHeight); 4060 4073 } 4061 4074 … … 4092 4105 else 4093 4106 mDesktopGeometry = QRect (0, 0, 0, 0); 4094 s etDesktopGeoHint(0, 0);4107 storeConsoleSize (0, 0); 4095 4108 break; 4096 4109 case DesktopGeo_Automatic: 4097 4110 mDesktopGeo = DesktopGeo_Automatic; 4098 4111 mDesktopGeometry = QRect (0, 0, 0, 0); 4099 s etDesktopGeoHint(0, 0);4112 storeConsoleSize (0, 0); 4100 4113 break; 4101 4114 case DesktopGeo_Any:
Note:
See TracChangeset
for help on using the changeset viewer.