Changeset 65419 in vbox for trunk/src/VBox
- Timestamp:
- Jan 24, 2017 10:58:56 AM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r65417 r65419 52 52 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 53 53 , m_fWasMinimized(false) 54 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 55 , m_fIsMinimized(false) 56 #endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */ 54 57 { 55 58 } … … 298 301 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 299 302 303 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 304 void UIMachineWindowSeamless::changeEvent(QEvent *pEvent) 305 { 306 switch (pEvent->type()) 307 { 308 case QEvent::WindowStateChange: 309 { 310 /* Watch for window state changes: */ 311 QWindowStateChangeEvent *pChangeEvent = static_cast<QWindowStateChangeEvent*>(pEvent); 312 LogRel2(("GUI: UIMachineWindowSeamless::changeEvent: Window state changed from %d to %d\n", 313 (int)pChangeEvent->oldState(), (int)windowState())); 314 if ( windowState() == Qt::WindowMinimized 315 && pChangeEvent->oldState() == Qt::WindowNoState 316 && !m_fIsMinimized) 317 { 318 /* Mark window minimized, isMinimized() is not enough due to Qt5vsX11 fight: */ 319 LogRel2(("GUI: UIMachineWindowSeamless::changeEvent: Window minimized\n")); 320 m_fIsMinimized = true; 321 } 322 else 323 if ( windowState() == Qt::WindowNoState 324 && pChangeEvent->oldState() == Qt::WindowMinimized 325 && m_fIsMinimized) 326 { 327 /* Mark window restored, and do manual restoring with showInNecessaryMode(): */ 328 LogRel2(("GUI: UIMachineWindowSeamless::changeEvent: Window restored\n")); 329 m_fIsMinimized = false; 330 showInNecessaryMode(); 331 } 332 break; 333 } 334 default: 335 break; 336 } 337 338 /* Call to base-class: */ 339 UIMachineWindow::changeEvent(pEvent); 340 } 341 #endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */ 342 300 343 #ifdef VBOX_WS_WIN 301 344 # if QT_VERSION >= 0x050000 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
r62493 r65419 74 74 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */ 75 75 76 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 77 /** Handles @a pEvent about state change. */ 78 void changeEvent(QEvent *pEvent); 79 #endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */ 80 76 81 #ifdef VBOX_WS_WIN 77 82 # if QT_VERSION >= 0x050000 … … 101 106 * Used to restore minimized state when the window shown again. */ 102 107 bool m_fWasMinimized; 108 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 109 /** Holds whether the window is currently minimized. 110 * Used to restore maximized state when the window restored again. */ 111 bool m_fIsMinimized; 112 #endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */ 103 113 104 114 /** Factory support. */
Note:
See TracChangeset
for help on using the changeset viewer.