Changeset 49401 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Nov 6, 2013 6:02:27 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90457
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r49184 r49401 219 219 int iWidth, int iHeight) 220 220 { 221 // TODO: Move to appropriate place! 221 222 /* Some situations require frame-buffer resize-events to be ignored at all, 222 223 * leaving machine-window, machine-view and frame-buffer sizes preserved: */ … … 224 225 return; 225 226 226 /* If only the pitch has changed (or nothing at all!) we only update the227 * frame-buffer and don't touch the window. This prevents unwanted resizes228 * when entering or exiting fullscreen on X.Org guests and when229 * re-attaching the frame-buffer on a view switch. */230 bool fResize = (ulong)iWidth != frameBuffer()->width()231 || (ulong)iHeight != frameBuffer()->height();232 233 227 /* If machine-window is visible: */ 234 228 if (uisession()->isScreenVisible(m_uScreenId)) 235 229 { 236 /* Apply current window size to frame-buffer: */ 230 // TODO: Move to appropriate place! 231 /* Adjust 'scale' mode for current machine-view size: */ 237 232 if (visualStateType() == UIVisualStateType_Scale) 238 233 frameBuffer()->setScaledSize(size()); 239 234 240 /* Compose guest resize-event:*/241 UIResizeEvent resizeEvent(iPixelFormat, pVRAM,242 iBitsPerPixel, iBytesPerLine,243 iWidth, iHeight); 244 245 /* Perform frame-buffer resize if parent window is visible: */235 /* Is there a proposal for frame-buffer resize? */ 236 bool fResizeProposed = (ulong)iWidth != frameBuffer()->width() || 237 (ulong)iHeight != frameBuffer()->height(); 238 239 /* Perform frame-buffer mode-change: */ 240 UIResizeEvent resizeEvent(iPixelFormat, pVRAM, iBitsPerPixel, iBytesPerLine, iWidth, iHeight); 246 241 frameBuffer()->resizeEvent(&resizeEvent); 247 } 248 249 /* If resize actually happens and machine-window is visible: */ 250 if (fResize && uisession()->isScreenVisible(m_uScreenId)) 251 { 252 /* Scale-mode doesn't need this: */ 253 if (visualStateType() != UIVisualStateType_Scale) 254 { 255 /* Reapply maximum size restriction for machine-view: */ 256 setMaximumSize(sizeHint()); 257 258 /* Disable the resize hint override hack: */ 259 m_sizeHintOverride = QSize(-1, -1); 260 261 /* Perform machine-view resize: */ 262 resize(iWidth, iHeight); 263 } 264 265 /* Let our toplevel widget calculate its sizeHint properly: */ 266 QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest); 242 243 /* Was framebuffer actually resized? */ 244 if (fResizeProposed) 245 { 246 /* Scale-mode doesn't need this.. */ 247 if (visualStateType() != UIVisualStateType_Scale) 248 { 249 /* Adjust maximum-size restriction for machine-view: */ 250 setMaximumSize(sizeHint()); 251 252 /* Disable the resize hint override hack: */ 253 m_sizeHintOverride = QSize(-1, -1); 254 255 /* Force machine-window update own layout: */ 256 QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest); 257 258 /* Update machine-view sliders: */ 259 updateSliders(); 260 261 /* By some reason Win host forgets to update machine-window central-widget 262 * after main-layout was updated, let's do it for all the hosts: */ 263 machineWindow()->centralWidget()->update(); 264 265 /* Normalize machine-window geometry: */ 266 if (visualStateType() == UIVisualStateType_Normal) 267 machineWindow()->normalizeGeometry(true /* adjust position */); 268 } 267 269 268 270 #ifdef Q_WS_MAC 269 machineLogic()->updateDockIconSize(screenId(), iWidth, iHeight); 271 /* Update MacOS X dock icon size: */ 272 machineLogic()->updateDockIconSize(screenId(), iWidth, iHeight); 270 273 #endif /* Q_WS_MAC */ 271 272 /* Scale-mode doesn't need this: */273 if (visualStateType() != UIVisualStateType_Scale)274 {275 /* Update machine-view sliders: */276 updateSliders();277 278 /* Normalize machine-window geometry: */279 if (visualStateType() == UIVisualStateType_Normal)280 machineWindow()->normalizeGeometry(true /* adjust position */);281 274 } 282 275 }
Note:
See TracChangeset
for help on using the changeset viewer.