Changeset 6441 in vbox
- Timestamp:
- Jan 22, 2008 1:44:12 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27416
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r5999 r6441 182 182 void onExitFullscreen(); 183 183 184 void setViewInSeamlessMode(const QRect& targetRect); 185 184 186 private: 185 187 … … 248 250 bool statusBarChangedInside; 249 251 250 QSpacerItem *mShiftingSpacer; 252 QSpacerItem *mShiftingSpacerLeft; 253 QSpacerItem *mShiftingSpacerTop; 254 QSpacerItem *mShiftingSpacerRight; 255 QSpacerItem *mShiftingSpacerBottom; 251 256 252 257 #ifdef VBOX_WITH_DEBUGGER_GUI -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r6184 r6441 1057 1057 mIgnoreMainwndResize = oldIgnoreMainwndResize; 1058 1058 1059 /* emit a signal about guest was resized */1060 emit resizeHintDone();1061 1062 1059 /* update geometry after entering fullscreen | seamless */ 1063 1060 if (mMainWnd->isTrueFullscreen() || mMainWnd->isTrueSeamless()) 1064 1061 updateGeometry(); 1065 1062 1063 /* make sure that all posted signals are processed */ 1064 qApp->processEvents(); 1065 1066 /* emit a signal about guest was resized */ 1067 emit resizeHintDone(); 1068 1066 1069 return true; 1067 1070 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r6284 r6441 631 631 { 632 632 setCentralWidget (new QWidget (this, "centralWidget")); 633 new QBoxLayout (centralWidget(), QBoxLayout::Down); 633 QGridLayout *pMainLayout = new QGridLayout(centralWidget(), 3, 3, 0, 0); 634 mShiftingSpacerLeft = new QSpacerItem (0, 0, 635 QSizePolicy::Fixed, 636 QSizePolicy::Fixed); 637 mShiftingSpacerTop = new QSpacerItem (0, 0, 638 QSizePolicy::Fixed, 639 QSizePolicy::Fixed); 640 mShiftingSpacerRight = new QSpacerItem (0, 0, 641 QSizePolicy::Fixed, 642 QSizePolicy::Fixed); 643 mShiftingSpacerBottom = new QSpacerItem (0, 0, 644 QSizePolicy::Fixed, 645 QSizePolicy::Fixed); 646 pMainLayout->addItem(mShiftingSpacerLeft, 1, 0); 647 pMainLayout->addMultiCell(mShiftingSpacerTop, 0, 0, 0, 2); 648 pMainLayout->addItem(mShiftingSpacerRight, 1, 2); 649 pMainLayout->addMultiCell(mShiftingSpacerBottom, 2, 2, 0, 2); 634 650 } 635 651 … … 646 662 activateUICustomizations(); 647 663 648 ((QBoxLayout*) centralWidget()->layout())->addWidget ( 649 console, 0, AlignVCenter | AlignHCenter); 650 651 mShiftingSpacer = new QSpacerItem (0, 0, QSizePolicy::Expanding, 652 QSizePolicy::Fixed); 653 ((QBoxLayout*) centralWidget()->layout())->addItem (mShiftingSpacer); 654 664 static_cast<QGridLayout*>(centralWidget()->layout())->addWidget(console, 1, 1, AlignVCenter | AlignHCenter); 665 655 666 CMachine cmachine = csession.GetMachine(); 656 667 … … 996 1007 { 997 1008 disconnect (console, SIGNAL (resizeHintDone()), 0, 0); 1009 #ifndef Q_WS_MAC 1010 /* It isn't guaranteed that the guest os set the video mode that 1011 * we requested. So after all the resizing stuff set the clipping 1012 * mask and the spacing shifter to the corresponding values. */ 1013 setViewInSeamlessMode(QRect(console->mapToGlobal(QPoint(0, 0)), console->size())); 1014 #endif 998 1015 999 1016 vmSeamlessAction->setEnabled (mIsSeamless); … … 1895 1912 bool VBoxConsoleWnd::toggleFullscreenMode (bool aOn, bool aSeamless) 1896 1913 { 1914 1897 1915 if (aSeamless) 1898 1916 { … … 1995 2013 dtw->availableGeometry (this) : dtw->screenGeometry (this); 1996 2014 1997 /* Calculate the difference region between current mode 1998 * (fullscreen or seamless) and the screen geometry. */ 1999 mStrictedRegion = 2000 QRegion (dtw->screenGeometry (this)) - scrGeo; 2001 2002 /* Setup the shifting spacer to make the console to be aligned on top 2003 * in the seamless mode. */ 2004 #ifdef Q_WS_MAC 2005 mShiftingSpacer->changeSize (0, dtw->screenGeometry(this).bottom() - scrGeo.bottom(), 2006 QSizePolicy::Preferred, QSizePolicy::Fixed); 2007 #else 2008 mShiftingSpacer->changeSize (0, mStrictedRegion.boundingRect().height(), 2009 QSizePolicy::Preferred, QSizePolicy::Fixed); 2010 #endif 2015 /* It isn't guaranteed that the guest os set the video mode that 2016 * we requested. So after all the resizing stuff set the clipping 2017 * mask and the spacing shifter to the corresponding values. */ 2018 setViewInSeamlessMode(dtw->availableGeometry(this)); 2011 2019 2012 2020 #ifdef Q_WS_WIN32 … … 2052 2060 setWindowState (windowState() ^ WindowFullScreen); 2053 2061 #ifdef Q_WS_MAC /* setMask seems to not include the far border pixels. */ 2054 QRect maskRect = dtw->screenGeometry (this); 2055 maskRect.setRight (maskRect.right() + 1); 2056 maskRect.setBottom (maskRect.bottom() + 1); 2057 setMask (maskRect); 2062 // QRect maskRect = dtw->screenGeometry (this); 2063 // maskRect.setRight (maskRect.right() + 1); 2064 // maskRect.setBottom (maskRect.bottom() + 1); 2065 // setMask (maskRect); 2066 2058 2067 #else 2059 setMask (dtw->screenGeometry (this));2068 // setMask (dtw->screenGeometry (this)); 2060 2069 #endif 2061 2070 … … 2073 2082 2074 2083 /* Reset the shifting spacer. */ 2075 mShiftingSpacer->changeSize (0, 0, QSizePolicy::Preferred, 2076 QSizePolicy::Fixed); 2084 mShiftingSpacerLeft->changeSize (0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed); 2085 mShiftingSpacerTop->changeSize (0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed); 2086 mShiftingSpacerRight->changeSize (0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed); 2087 mShiftingSpacerBottom->changeSize (0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed); 2077 2088 2078 2089 /* Restore the previous scroll-view minimum size before the exiting … … 2121 2132 // Private slots 2122 2133 ///////////////////////////////////////////////////////////////////////////// 2134 void VBoxConsoleWnd::setViewInSeamlessMode(const QRect& targetRect) 2135 { 2136 if (mIsSeamless) 2137 { 2138 /* It isn't guaranteed that the guest os set the video mode that 2139 * we requested. So after all the resizing stuff set the clipping 2140 * mask and the spacing shifter to the corresponding values. */ 2141 QDesktopWidget *dtw = QApplication::desktop(); 2142 QRect sRect = dtw->screenGeometry (this); 2143 QRect aRect(targetRect); 2144 QRect a1Rect(targetRect); 2145 #ifdef Q_WS_MAC 2146 /* On mac os x this isn't necessary cause the screen starts 2147 * by y=0 always regardless if there is the global menubar or not. */ 2148 aRect.setRect(aRect.left(), 0, aRect.width(), aRect.height()+aRect.top()); 2149 a1Rect.setRect(a1Rect.left(), 0, a1Rect.width(), a1Rect.height()); 2150 #endif // Q_WS_MAC 2151 /* Set the clipping mask */ 2152 mStrictedRegion = QRegion(sRect) - a1Rect; 2153 /* Set the shifting spacer */ 2154 mShiftingSpacerLeft->changeSize(RT_ABS(sRect.left() - aRect.left()), 0, 2155 QSizePolicy::Fixed, QSizePolicy::Preferred); 2156 mShiftingSpacerTop->changeSize(0, RT_ABS(sRect.top() - aRect.top()), 2157 QSizePolicy::Preferred, QSizePolicy::Fixed); 2158 mShiftingSpacerRight->changeSize(RT_ABS(sRect.right() - aRect.right()), 0, 2159 QSizePolicy::Fixed, QSizePolicy::Preferred); 2160 mShiftingSpacerBottom->changeSize(0, RT_ABS(sRect.bottom() - aRect.bottom()), 2161 QSizePolicy::Preferred, QSizePolicy::Fixed); 2162 } 2163 } 2123 2164 2124 2165 void VBoxConsoleWnd::vmFullscreen (bool aOn) … … 2513 2554 void VBoxConsoleWnd::setMask (const QRegion &aRegion) 2514 2555 { 2515 QRegion region = aRegion - mStrictedRegion; 2556 QRegion region = aRegion; 2557 region.translate(mShiftingSpacerLeft->sizeHint().width(), mShiftingSpacerTop->sizeHint().height()); 2558 region -= mStrictedRegion; 2559 2560 #ifdef Q_WS_MAC 2561 /* This is necessary to avoid the flicker by 2562 * an mask update. 2563 * See http://lists.apple.com/archives/Carbon-development/2001/Apr/msg01651.html 2564 * for the hint. 2565 * There *must* be a better solution. */ 2566 if(!region.isEmpty()) 2567 region |= QRect(0, 0, 1, 1); 2568 #endif 2516 2569 2517 2570 #ifdef Q_WS_WIN … … 2520 2573 /* Region offset calculation */ 2521 2574 int fleft = 0, ftop = 0; 2522 if (isTopLevel()) 2523 { 2524 ftop = topData()->ftop; 2525 fleft = topData()->fleft; 2526 } 2575 /* I think this isn't necessary anymore because the 4 shifting spacer. 2576 * Has to be verified. */ 2577 // if (isTopLevel()) 2578 // { 2579 // ftop = topData()->ftop; 2580 // fleft = topData()->fleft; 2581 // } 2527 2582 2528 2583 /* Visible region calculation */ … … 3035 3090 vmAutoresizeGuestAction->setEnabled (aActive); 3036 3091 vmSeamlessAction->setEnabled (aSeamlessSupported); 3037 #ifndef Q_WS_MAC /** @todo fix seamless mode on Mac OS X. It is temporarily disabled to prevent bogus bugreports for the beta 3 / beta 2 leopard update. */3092 //#ifndef Q_WS_MAC /** @todo fix seamless mode on Mac OS X. It is temporarily disabled to prevent bogus bugreports for the beta 3 / beta 2 leopard update. */ 3038 3093 mIsSeamlessSupported = aSeamlessSupported; 3039 #endif3094 //#endif 3040 3095 /* If seamless mode should be enabled then check if it is enabled 3041 3096 * currently and re-enable it if open-view procedure is finished */
Note:
See TracChangeset
for help on using the changeset viewer.