Changeset 26937 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 2, 2010 11:00:50 AM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r26931 r26937 40 40 41 41 #include "VBoxUtils.h" 42 43 #ifdef Q_WS_MAC 44 # ifdef QT_MAC_USE_COCOA 45 # include <Carbon/Carbon.h> 46 # endif /* QT_MAC_USE_COCOA */ 47 #endif /* Q_WS_MAC */ 42 48 43 49 UIMachineLogicFullscreen::UIMachineLogicFullscreen(QObject *pParent, UISession *pSession, UIActionsPool *pActionsPool) … … 152 158 * This is necessary for Qt versions > 4.3.3: */ 153 159 ::darwinSetFrontMostProcess(); 160 setPresentationModeEnabled(true); 154 161 #endif /* Q_WS_MAC */ 155 162 … … 264 271 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 265 272 UIMachineWindow::destroy(pMachineWindow); 266 } 267 273 274 #ifdef Q_WS_MAC 275 setPresentationModeEnabled(false); 276 #endif/* Q_WS_MAC */ 277 } 278 279 #ifdef Q_WS_MAC 280 # ifdef QT_MAC_USE_COCOA 281 void UIMachineLogicFullscreen::setPresentationModeEnabled(bool fEnabled) 282 { 283 if (fEnabled) 284 { 285 /* First check if we are on the primary screen, only than the 286 * presentation mode have to be changed. */ 287 // TODO_NEW_CORE: we need some algorithm to decide which virtual screen 288 // is on which physical host display. Than we can decide on the 289 // presentation mode as well. */ 290 // QDesktopWidget* pDesktop = QApplication::desktop(); 291 // if (pDesktop->screenNumber(this) == pDesktop->primaryScreen()) 292 { 293 QString testStr = vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_PresentationModeEnabled).toLower(); 294 /* Default to false if it is an empty value */ 295 if (testStr.isEmpty() || testStr == "false") 296 SetSystemUIMode(kUIModeAllHidden, 0); 297 else 298 SetSystemUIMode(kUIModeAllSuppressed, 0); 299 } 300 } 301 else 302 SetSystemUIMode(kUIModeNormal, 0); 303 } 304 # endif /* QT_MAC_USE_COCOA */ 305 #endif /* Q_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h
r26931 r26937 60 60 void cleanupActionConnections() {} 61 61 62 #ifdef Q_WS_MAC 63 # ifdef QT_MAC_USE_COCOA 64 void setPresentationModeEnabled(bool fEnabled); 65 # endif /* QT_MAC_USE_COCOA */ 66 #endif /* Q_WS_MAC */ 67 62 68 /* Friend classes: */ 63 69 friend class UIMachineLogic; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r26931 r26937 36 36 #include "UIMachineView.h" 37 37 #include "UIMachineWindowFullscreen.h" 38 39 #ifdef Q_WS_MAC40 # ifdef QT_MAC_USE_COCOA41 # include <Carbon/Carbon.h>42 # endif /* QT_MAC_USE_COCOA */43 #endif /* Q_WS_MAC */44 38 45 39 UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId) … … 316 310 Mac */ 317 311 show(); 312 move(0,0); 318 313 319 314 #ifdef Q_WS_MAC … … 325 320 /* Here we are going really fullscreen */ 326 321 setWindowState(windowState() ^ Qt::WindowFullScreen); 327 setPresentationModeEnabled(true);328 322 329 323 # ifndef QT_MAC_USE_COCOA … … 354 348 { 355 349 } 356 357 #ifdef Q_WS_MAC358 setPresentationModeEnabled(false);359 #endif/* Q_WS_MAC */360 350 } 361 351 … … 370 360 } 371 361 372 #ifdef Q_WS_MAC373 # ifdef QT_MAC_USE_COCOA374 void UIMachineWindowFullscreen::setPresentationModeEnabled(bool fEnabled)375 {376 if (fEnabled)377 {378 /* First check if we are on the primary screen, only than the presentation mode have to be changed. */379 QDesktopWidget* pDesktop = QApplication::desktop();380 if (pDesktop->screenNumber(this) == pDesktop->primaryScreen())381 {382 QString testStr = vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_PresentationModeEnabled).toLower();383 /* Default to false if it is an empty value */384 if (testStr.isEmpty() || testStr == "false")385 SetSystemUIMode(kUIModeAllHidden, 0);386 else387 SetSystemUIMode(kUIModeAllSuppressed, 0);388 }389 }390 else391 SetSystemUIMode(kUIModeNormal, 0);392 }393 # endif /* QT_MAC_USE_COCOA */394 #endif /* Q_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r26921 r26937 99 99 100 100 #ifdef Q_WS_MAC 101 # ifdef QT_MAC_USE_COCOA102 void setPresentationModeEnabled(bool fEnabled);103 # endif /* QT_MAC_USE_COCOA */104 101 CGDisplayFadeReservationToken mFadeToken; 105 102 #endif /* Q_WS_MAC */
Note:
See TracChangeset
for help on using the changeset viewer.