Changeset 44909 in vbox
- Timestamp:
- Mar 4, 2013 11:25:30 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84079
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r44865 r44909 200 200 { 201 201 return session().GetMachine(); 202 } 203 204 void UIMachineWindow::setMask(const QRegion ®ion) 205 { 206 /* Call to base-class: */ 207 QMainWindow::setMask(region); 202 208 } 203 209 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r44865 r44909 61 61 CSession& session() const; 62 62 CMachine machine() const; 63 64 /* Virtual caller for base class setMask: */ 65 virtual void setMask(const QRegion ®ion); 63 66 64 67 protected slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r44859 r44909 299 299 void UIMachineWindowSeamless::setMask(const QRegion &constRegion) 300 300 { 301 /* Could be unused under Mac: */ 302 Q_UNUSED(constRegion); 303 304 #ifndef Q_WS_MAC 305 /* Copy mask: */ 301 306 QRegion region = constRegion; 302 307 … … 305 310 region.translate(m_pLeftSpacer->geometry().width(), m_pTopSpacer->geometry().height()); 306 311 307 #if 0 // TODO: Is it really needed now? 308 /* The global mask shift cause of toolbars and such things. */ 309 region.translate(mMaskShift.width(), mMaskShift.height()); 310 #endif 311 312 /* Mini tool-bar: */ 313 #ifndef Q_WS_MAC 312 /* Take into account mini tool-bar region: */ 314 313 if (m_pMiniToolBar) 315 314 { 316 /* Get mini-toolbar mask: */315 /* Move mini-toolbar region to mini-toolbar position: */ 317 316 QRegion toolBarRegion(m_pMiniToolBar->rect()); 318 319 /* Move mini-toolbar mask to mini-toolbar position: */320 317 toolBarRegion.translate(QPoint(m_pMiniToolBar->x(), m_pMiniToolBar->y())); 321 322 /* Including mini-toolbar mask: */ 318 /* Include mini-toolbar region into common one: */ 323 319 region += toolBarRegion; 324 320 } 325 321 #endif /* !Q_WS_MAC */ 326 322 327 #if 0 // TODO: Is it really needed now? 328 /* Restrict the drawing to the available space on the screen. 329 * (The &operator is better than the previous used -operator, 330 * because this excludes space around the real screen also. 331 * This is necessary for the mac.) */ 332 region &= mStrictedRegion; 333 #endif 334 335 #ifdef Q_WS_WIN 323 #if defined (Q_WS_WIN) 324 # if 0 /* This code is disabled for a long time already, need analisys... */ 336 325 QRegion difference = m_prevRegion.subtract(region); 337 326 … … 356 345 357 346 m_prevRegion = region; 347 # endif /* This code is disabled for a long time already, need analisys... */ 348 UIMachineWindow::setMask(region); 358 349 #elif defined (Q_WS_MAC) 359 350 # if defined (VBOX_GUI_USE_QUARTZ2D) 360 351 if (vboxGlobal().vmRenderMode() == Quartz2DMode) 361 352 { 362 /* If we are using the Quartz2D backend we have to trigger 363 * an repaint only. All the magic clipping stuff is done 364 * in the paint engine. */ 353 /* If we are using the Quartz2D backend we have to trigger a repaint only. 354 * All the magic clipping stuff is done in the paint engine. */ 365 355 ::darwinWindowInvalidateShape(m_pMachineView->viewport()); 366 356 } 367 else 368 # endif 369 { 370 /* This is necessary to avoid the flicker by an mask update. 371 * See http://lists.apple.com/archives/Carbon-development/2001/Apr/msg01651.html 372 * for the hint. 373 * There *must* be a better solution. */ 374 if (!region.isEmpty()) 375 region |= QRect (0, 0, 1, 1); 376 // /* Save the current region for later processing in the darwin event handler. */ 377 // mCurrRegion = region; 378 // /* We repaint the screen before the ReshapeCustomWindow command. Unfortunately 379 // * this command flushes a copy of the backbuffer to the screen after the new 380 // * mask is set. This leads into a misplaced drawing of the content. Currently 381 // * no alternative to this and also this is not 100% perfect. */ 382 // repaint(); 383 // qApp->processEvents(); 384 // /* Now force the reshaping of the window. This is definitely necessary. */ 385 // ReshapeCustomWindow (reinterpret_cast <WindowPtr> (winId())); 386 UIMachineWindow::setMask(region); 387 // HIWindowInvalidateShadow (::darwinToWindowRef (mConsole->viewport())); 388 } 389 #else 357 # endif /* VBOX_GUI_USE_QUARTZ2D */ 358 # if 0 /* This code is disabled for a long time already, need analisys... */ 359 /* This is necessary to avoid the flicker by an mask update. 360 * See http://lists.apple.com/archives/Carbon-development/2001/Apr/msg01651.html for the hint. 361 * There *must* be a better solution. */ 362 // if (!region.isEmpty()) 363 // region |= QRect(0, 0, 1, 1); 364 // /* Save the current region for later processing in the darwin event handler. */ 365 // mCurrRegion = region; 366 // /* We repaint the screen before the ReshapeCustomWindow command. Unfortunately 367 // * this command flushes a copy of the backbuffer to the screen after the new 368 // * mask is set. This leads into a misplaced drawing of the content. Currently 369 // * no alternative to this and also this is not 100% perfect. */ 370 // repaint(); 371 // qApp->processEvents(); 372 // /* Now force the reshaping of the window. This is definitely necessary. */ 373 // ReshapeCustomWindow(reinterpret_cast<WindowPtr>(winId())); 374 // UIMachineWindow::setMask(region); 375 // HIWindowInvalidateShadow(::darwinToWindowRef(mConsole->viewport())); 376 # endif /* This code is disabled for a long time already, need analisys... */ 377 #else /* !Q_WS_MAC */ 390 378 UIMachineWindow::setMask(region); 391 379 #endif
Note:
See TracChangeset
for help on using the changeset viewer.