Changeset 50631 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 27, 2014 2:46:41 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r50514 r50631 597 597 void UIMachineLogic::sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect) 598 598 { 599 /* Deliver event to all machine-windows: */ 599 LogRel(("UIMachineLogic: Guest-screen count changed.\n")); 600 601 /* Make sure all machine-window(s) have proper geometry: */ 600 602 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 601 pMachineWindow-> handleScreenCountChange();603 pMachineWindow->showInNecessaryMode(); 602 604 } 603 605 604 606 void UIMachineLogic::sltHostScreenCountChanged() 605 607 { 606 /* Deliver event to all machine-windows: */ 608 LogRel(("UIMachineLogic: Host-screen count changed.\n")); 609 610 /* Make sure all machine-window(s) have proper geometry: */ 607 611 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 608 pMachineWindow-> handleScreenCountChange();612 pMachineWindow->showInNecessaryMode(); 609 613 } 610 614 611 615 void UIMachineLogic::sltHostScreenGeometryChanged() 612 616 { 613 LogRel Flow(("UIMachineLogic: Host-screen geometry changed.\n"));614 615 /* Deliver event to all machine-windows: */617 LogRel(("UIMachineLogic: Host-screen geometry changed.\n")); 618 619 /* Make sure all machine-window(s) have proper geometry: */ 616 620 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 617 pMachineWindow-> handleScreenGeometryChange();621 pMachineWindow->showInNecessaryMode(); 618 622 } 619 623 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r50505 r50631 442 442 } 443 443 444 void UIMachineWindow::handleScreenCountChange()445 {446 /* Ignore if window is minimized: */447 if (isMinimized())448 return;449 450 /* Make sure window is in necessary mode: */451 showInNecessaryMode();452 }453 454 void UIMachineWindow::handleScreenGeometryChange()455 {456 /* Ignore if window is minimized: */457 if (isMinimized())458 return;459 460 /* Make sure window is in necessary mode: */461 showInNecessaryMode();462 }463 464 444 void UIMachineWindow::updateAppearanceOf(int iElement) 465 445 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r50522 r50631 121 121 virtual void cleanupSessionConnections() {} 122 122 123 /* Visibility stuff: */124 void handleScreenCountChange();125 void handleScreenGeometryChange();126 127 123 /* Update stuff: */ 128 124 virtual void updateAppearanceOf(int iElement); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r50598 r50631 85 85 /* We should rebuild screen-layout: */ 86 86 m_pScreenLayout->rebuild(); 87 /* And update machine-windows sizes finally: */87 /* Make sure all machine-window(s) have proper geometry: */ 88 88 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 89 pMachineWindow-> handleScreenGeometryChange();89 pMachineWindow->showInNecessaryMode(); 90 90 } 91 91 … … 150 150 /* Reactivate 'presentation mode': */ 151 151 setPresentationModeEnabled(true); 152 /* Re-enter fullscreen mode: */152 /* Make sure all machine-window(s) have proper geometry: */ 153 153 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 154 154 pMachineWindow->showInNecessaryMode(); 155 /* Re-enter fullscreen mode: */ 155 156 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 156 157 if ( uisession()->isScreenVisible(pMachineWindow->screenId()) … … 243 244 /* We should rebuild screen-layout: */ 244 245 m_pScreenLayout->rebuild(); 245 /* We should update machine-windows sizes: */246 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 247 pMachineWindow-> handleScreenGeometryChange();246 /* Make sure all machine-window(s) have proper geometry: */ 247 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 248 pMachineWindow->showInNecessaryMode(); 248 249 } 249 250 } … … 262 263 if (vboxGlobal().osRelease() <= MacOSXRelease_Lion) 263 264 { 264 /* Update machine-window(s) location/size: */265 /* Make sure all machine-window(s) have proper geometry: */ 265 266 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 266 267 pMachineWindow->showInNecessaryMode(); … … 271 272 else invalidateFullscreenMode(); 272 273 #else /* !Q_WS_MAC */ 273 /* Update machine-window(s) location/size: */274 /* Make sure all machine-window(s) have proper geometry: */ 274 275 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 275 276 pMachineWindow->showInNecessaryMode(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r50597 r50631 246 246 void UIMachineWindowFullscreen::showInNecessaryMode() 247 247 { 248 /* Should we show window?: */ 249 if (uisession()->isScreenVisible(m_uScreenId)) 250 { 251 /* Do we have the seamless logic? */ 252 if (UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic())) 253 { 254 /* Is this guest screen has own host screen? */ 255 if (pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId)) 256 { 257 /* Make sure the window is maximized and placed on valid screen: */ 258 placeOnScreen(); 248 /* Make sure this window should be shown at all: */ 249 if (!uisession()->isScreenVisible(m_uScreenId)) 250 return hide(); 251 252 /* Make sure this window has fullscreen logic: */ 253 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic()); 254 if (!pFullscreenLogic) 255 return hide(); 256 257 /* Make sure this window mapped to some host-screen: */ 258 if (!pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId)) 259 return hide(); 260 261 /* Make sure this window is not minimized: */ 262 if (isMinimized()) 263 return; 264 265 /* Make sure this window is maximized and placed on valid screen: */ 266 placeOnScreen(); 259 267 260 268 #ifdef Q_WS_WIN 261 /* On Windows we should activate main window first, 262 * because entering fullscreen there doesn't means window will be auto-activated, 263 * so no window-activation event will be received 264 * and no keyboard-hook created otherwise... */ 265 if (m_uScreenId == 0) 266 setWindowState(windowState() | Qt::WindowActive); 269 /* On Windows we should activate main window first, 270 * because entering fullscreen there doesn't means window will be auto-activated, 271 * so no window-activation event will be received and no keyboard-hook created otherwise... */ 272 if (m_uScreenId == 0) 273 setWindowState(windowState() | Qt::WindowActive); 267 274 #endif /* Q_WS_WIN */ 268 275 269 276 #ifdef Q_WS_MAC 270 271 272 /* Lion and previous still using Qt one,call for showFullScreen(): */273 277 /* ML and next using native stuff, so we can call for simple show(): */ 278 if (vboxGlobal().osRelease() > MacOSXRelease_Lion) show(); 279 /* Lion and previous using Qt stuff, so we should call for showFullScreen(): */ 280 else showFullScreen(); 274 281 #else /* !Q_WS_MAC */ 275 276 282 /* Show in fullscreen mode: */ 283 showFullScreen(); 277 284 #endif /* !Q_WS_MAC */ 278 285 279 /* Make sure the window is placed on valid screen again 280 * after window is shown & window's decorations applied. 281 * That is required (still?) due to X11 Window Geometry Rules. */ 282 placeOnScreen(); 283 284 /* Return early: */ 285 return; 286 } 287 } 288 } 289 /* Hide in other cases: */ 290 hide(); 286 #ifdef Q_WS_X11 287 /* Make sure the window is placed on valid screen again 288 * after window is shown & window's decorations applied. 289 * That is required (still?) due to X11 Window Geometry Rules. */ 290 placeOnScreen(); 291 #endif /* Q_WS_X11 */ 291 292 } 292 293 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r50309 r50631 609 609 void UIMachineWindowNormal::showInNecessaryMode() 610 610 { 611 /* Show window if we have to: */ 612 if (uisession()->isScreenVisible(m_uScreenId)) 613 show(); 614 /* Else hide window: */ 615 else 616 hide(); 611 /* Make sure this window should be shown at all: */ 612 if (!uisession()->isScreenVisible(m_uScreenId)) 613 return hide(); 614 615 /* Make sure this window is not minimized: */ 616 if (isMinimized()) 617 return; 618 619 /* Show in normal mode: */ 620 show(); 617 621 } 618 622 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
r49462 r50631 197 197 void UIMachineWindowScale::showInNecessaryMode() 198 198 { 199 /* Show window if we have to: */ 200 if (uisession()->isScreenVisible(m_uScreenId)) 201 show(); 202 /* Else hide window: */ 203 else 204 hide(); 199 /* Make sure this window should be shown at all: */ 200 if (!uisession()->isScreenVisible(m_uScreenId)) 201 return hide(); 202 203 /* Make sure this window is not minimized: */ 204 if (isMinimized()) 205 return; 206 207 /* Show in normal mode: */ 208 show(); 205 209 } 206 210 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r50535 r50631 82 82 /* We should rebuild screen-layout: */ 83 83 m_pScreenLayout->rebuild(); 84 /* We should update machine-windows sizes: */84 /* Make sure all machine-window(s) have proper geometry: */ 85 85 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 86 pMachineWindow-> handleScreenGeometryChange();86 pMachineWindow->showInNecessaryMode(); 87 87 } 88 88 … … 140 140 /* We should rebuild screen-layout: */ 141 141 m_pScreenLayout->rebuild(); 142 /* We should update machine-windows sizes: */142 /* Make sure all machine-window(s) have proper geometry: */ 143 143 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 144 pMachineWindow-> handleScreenGeometryChange();144 pMachineWindow->showInNecessaryMode(); 145 145 } 146 146 } … … 148 148 void UIMachineLogicSeamless::sltScreenLayoutChanged() 149 149 { 150 /* Update machine-window(s) location/size: */150 /* Make sure all machine-window(s) have proper geometry: */ 151 151 foreach (UIMachineWindow *pMachineWindow, machineWindows()) 152 152 pMachineWindow->showInNecessaryMode(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r49462 r50631 214 214 void UIMachineWindowSeamless::showInNecessaryMode() 215 215 { 216 /* Should we show window?: */217 if ( uisession()->isScreenVisible(m_uScreenId))218 {219 /* Do we have the seamless logic? */ 220 if (UIMachineLogicSeamless *pSeamlessLogic = qobject_cast<UIMachineLogicSeamless*>(machineLogic()))221 {222 /* Is this guest screen has own host screen? */223 if (pSeamlessLogic->hasHostScreenForGuestScreen(m_uScreenId))224 { 225 /* Make sure the window is maximized and placed on validscreen: */226 placeOnScreen();227 228 /* Show in normal mode: */ 229 show();230 231 /* Return early: */232 return; 233 }234 }235 } 236 /* Hide in other cases: */237 hide();216 /* Make sure this window should be shown at all: */ 217 if (!uisession()->isScreenVisible(m_uScreenId)) 218 return hide(); 219 220 /* Make sure this window has seamless logic: */ 221 UIMachineLogicSeamless *pSeamlessLogic = qobject_cast<UIMachineLogicSeamless*>(machineLogic()); 222 if (!pSeamlessLogic) 223 return hide(); 224 225 /* Make sure this window mapped to some host-screen: */ 226 if (!pSeamlessLogic->hasHostScreenForGuestScreen(m_uScreenId)) 227 return hide(); 228 229 /* Make sure this window is not minimized: */ 230 if (isMinimized()) 231 return; 232 233 /* Make sure this window is maximized and placed on valid screen: */ 234 placeOnScreen(); 235 236 /* Show in normal mode: */ 237 show(); 238 238 } 239 239
Note:
See TracChangeset
for help on using the changeset viewer.