- Timestamp:
- May 5, 2010 12:07:15 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61119
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r28800 r29069 88 88 /* Check if valid: */ 89 89 if (!( fOk /* Valid data */ 90 91 90 && cScreen >= 0 && cScreen < m_cHostScreens /* In the host screen bounds? */ 91 && m_pScreenMap->key(cScreen, -1) == -1)) /* Not taken already? */ 92 92 /* If not, use one from the available screens */ 93 93 cScreen = availableScreens.first(); … … 130 130 { 131 131 return memoryRequirements(m_pScreenMap); 132 } 133 134 bool UIMultiScreenLayout::isHostTaskbarCovert() const 135 { 136 /* Check for all screens which are in use if they have some 137 * taskbar/menubar/dock on it. Its done by comparing the available with the 138 * screen geometry. Only if they are the same for all screens, there are no 139 * host area covert. This is a little bit ugly, but there seems no other 140 * way to find out if we are on a screen where the taskbar/dock or whatever 141 * is present. */ 142 QDesktopWidget *pDW = QApplication::desktop(); 143 for (int i = 0; i < m_pScreenMap->size(); ++i) 144 { 145 int hostScreen = m_pScreenMap->value(i); 146 if (pDW->availableGeometry(hostScreen) != pDW->screenGeometry(hostScreen)) 147 return true; 148 } 149 return false; 132 150 } 133 151 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h
r28800 r29069 43 43 int hostScreenForGuestScreen(int screenId) const; 44 44 quint64 memoryRequirements() const; 45 bool isHostTaskbarCovert() const; 45 46 46 47 signals: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r29062 r29069 199 199 200 200 #ifdef Q_WS_MAC 201 /* If the user change the screen, we have to decide again if the 202 * presentation mode should be changed. */ 203 connect(m_pScreenLayout, SIGNAL(screenLayoutChanged()), 204 this, SLOT(sltScreenLayoutChanged())); 201 205 /* Note: Presentation mode has to be set *after* the windows are created. */ 202 206 setPresentationModeEnabled(true); … … 237 241 } 238 242 243 void UIMachineLogicFullscreen::sltScreenLayoutChanged() 244 { 245 setPresentationModeEnabled(true); 246 } 247 239 248 void UIMachineLogicFullscreen::setPresentationModeEnabled(bool fEnabled) 240 249 { 241 if (fEnabled) 250 /* First check if we are on a screen which contains the Dock or the 251 * Menubar (which hasn't to be the same), only than the 252 * presentation mode have to be changed. */ 253 if ( fEnabled 254 && m_pScreenLayout->isHostTaskbarCovert()) 242 255 { 243 /* First check if we are on the primary screen, only than the 244 * presentation mode have to be changed. */ 245 // TODO_NEW_CORE: we need some algorithm to decide which virtual screen 246 // is on which physical host display. Than we can decide on the 247 // presentation mode as well. */ 248 // QDesktopWidget* pDesktop = QApplication::desktop(); 249 // if (pDesktop->screenNumber(this) == pDesktop->primaryScreen()) 250 { 251 QString testStr = vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_PresentationModeEnabled).toLower(); 252 /* Default to false if it is an empty value */ 253 if (testStr.isEmpty() || testStr == "false") 254 SetSystemUIMode(kUIModeAllHidden, 0); 255 else 256 SetSystemUIMode(kUIModeAllSuppressed, 0); 257 } 256 QString testStr = vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_PresentationModeEnabled).toLower(); 257 /* Default to false if it is an empty value */ 258 if (testStr.isEmpty() || testStr == "false") 259 SetSystemUIMode(kUIModeAllHidden, 0); 260 else 261 SetSystemUIMode(kUIModeAllSuppressed, 0); 258 262 } 259 263 else -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r28800 r29069 47 47 private slots: 48 48 49 #ifdef Q_WS_MAC49 #ifdef RT_OS_DARWIN 50 50 void sltChangePresentationMode(const VBoxChangePresentationModeEvent &event); 51 #endif /* Q_WS_MAC */ 51 void sltScreenLayoutChanged(); 52 #endif /* RT_OS_DARWIN */ 52 53 53 54 private:
Note:
See TracChangeset
for help on using the changeset viewer.