VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp@ 62493

Last change on this file since 62493 was 62493, checked in by vboxsync, 9 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.2 KB
Line 
1/* $Id: UIMachineWindowFullscreen.cpp 62493 2016-07-22 18:44:18Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachineWindowFullscreen class implementation.
4 */
5
6/*
7 * Copyright (C) 2010-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifdef VBOX_WITH_PRECOMPILED_HEADERS
19# include <precomp.h>
20#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
21
22/* Qt includes: */
23# include <QMenu>
24# include <QTimer>
25# ifdef VBOX_WS_WIN
26# if QT_VERSION >= 0x050000
27# include <QWindow>
28# endif /* QT_VERSION >= 0x050000 */
29# endif /* VBOX_WS_WIN */
30
31/* GUI includes: */
32# include "VBoxGlobal.h"
33# include "UIExtraDataManager.h"
34# include "UISession.h"
35# include "UIActionPoolRuntime.h"
36# include "UIMachineLogicFullscreen.h"
37# include "UIMachineWindowFullscreen.h"
38# include "UIMachineView.h"
39# if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
40# include "UIMachineDefs.h"
41# include "UIMiniToolBar.h"
42# elif defined(VBOX_WS_MAC)
43# include "UIFrameBuffer.h"
44# include "VBoxUtils-darwin.h"
45# include "UICocoaApplication.h"
46# endif /* VBOX_WS_MAC */
47
48/* COM includes: */
49# include "CSnapshot.h"
50
51#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
52
53
54UIMachineWindowFullscreen::UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId)
55 : UIMachineWindow(pMachineLogic, uScreenId)
56#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
57 , m_pMiniToolBar(0)
58#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
59#ifdef VBOX_WS_MAC
60 , m_fIsInFullscreenTransition(false)
61#endif /* VBOX_WS_MAC */
62 , m_fWasMinimized(false)
63#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
64 , m_fIsMinimized(false)
65#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
66{
67}
68
69#ifdef VBOX_WS_MAC
70void UIMachineWindowFullscreen::handleNativeNotification(const QString &strNativeNotificationName)
71{
72 /* Make sure this method is only used for ML and next: */
73 AssertReturnVoid(vboxGlobal().osRelease() > MacOSXRelease_Lion);
74
75 /* Log all arrived notifications: */
76 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: Notification '%s' received.\n",
77 strNativeNotificationName.toLatin1().constData()));
78
79 /* Handle 'NSWindowWillEnterFullScreenNotification' notification: */
80 if (strNativeNotificationName == "NSWindowWillEnterFullScreenNotification")
81 {
82 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
83 "Native fullscreen mode about to enter, notifying listener...\n"));
84 emit sigNotifyAboutNativeFullscreenWillEnter();
85 }
86 /* Handle 'NSWindowDidEnterFullScreenNotification' notification: */
87 else if (strNativeNotificationName == "NSWindowDidEnterFullScreenNotification")
88 {
89 /* Mark window transition complete: */
90 m_fIsInFullscreenTransition = false;
91 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
92 "Native fullscreen mode entered, notifying listener...\n"));
93 /* Update console's display viewport and 3D overlay: */
94 machineView()->updateViewport();
95 emit sigNotifyAboutNativeFullscreenDidEnter();
96 }
97 /* Handle 'NSWindowWillExitFullScreenNotification' notification: */
98 else if (strNativeNotificationName == "NSWindowWillExitFullScreenNotification")
99 {
100 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
101 "Native fullscreen mode about to exit, notifying listener...\n"));
102 emit sigNotifyAboutNativeFullscreenWillExit();
103 }
104 /* Handle 'NSWindowDidExitFullScreenNotification' notification: */
105 else if (strNativeNotificationName == "NSWindowDidExitFullScreenNotification")
106 {
107 /* Mark window transition complete: */
108 m_fIsInFullscreenTransition = false;
109 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
110 "Native fullscreen mode exited, notifying listener...\n"));
111 /* Update console's display viewport and 3D overlay: */
112 machineView()->updateViewport();
113 emit sigNotifyAboutNativeFullscreenDidExit();
114 }
115 /* Handle 'NSWindowDidFailToEnterFullScreenNotification' notification: */
116 else if (strNativeNotificationName == "NSWindowDidFailToEnterFullScreenNotification")
117 {
118 /* Mark window transition complete: */
119 m_fIsInFullscreenTransition = false;
120 LogRel(("UIMachineWindowFullscreen::handleNativeNotification: "
121 "Native fullscreen mode fail to enter, notifying listener...\n"));
122 emit sigNotifyAboutNativeFullscreenFailToEnter();
123 }
124}
125#endif /* VBOX_WS_MAC */
126
127#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
128void UIMachineWindowFullscreen::sltMachineStateChanged()
129{
130 /* Call to base-class: */
131 UIMachineWindow::sltMachineStateChanged();
132
133 /* Update mini-toolbar: */
134 updateAppearanceOf(UIVisualElement_MiniToolBar);
135}
136
137void UIMachineWindowFullscreen::sltRevokeWindowActivation()
138{
139 /* Make sure window is visible: */
140 if (!isVisible() || isMinimized())
141 return;
142
143 /* Revoke stolen activation: */
144#ifdef VBOX_WS_X11
145 raise();
146#endif /* VBOX_WS_X11 */
147 activateWindow();
148}
149#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
150
151#ifdef VBOX_WS_MAC
152void UIMachineWindowFullscreen::sltEnterNativeFullscreen(UIMachineWindow *pMachineWindow)
153{
154 /* Make sure this slot is called only under ML and next: */
155 AssertReturnVoid(vboxGlobal().osRelease() > MacOSXRelease_Lion);
156
157 /* Make sure it is NULL or 'this' window passed: */
158 if (pMachineWindow && pMachineWindow != this)
159 return;
160
161 /* Make sure this window has fullscreen logic: */
162 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
163 AssertPtrReturnVoid(pFullscreenLogic);
164
165 /* Make sure this window should be shown and mapped to host-screen: */
166 if (!uisession()->isScreenVisible(m_uScreenId) ||
167 !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
168 return;
169
170 /* Mark window 'transitioned to fullscreen': */
171 m_fIsInFullscreenTransition = true;
172
173 /* Enter native fullscreen mode if necessary: */
174 if ( (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
175 && !darwinIsInFullscreenMode(this))
176 darwinToggleFullscreenMode(this);
177}
178
179void UIMachineWindowFullscreen::sltExitNativeFullscreen(UIMachineWindow *pMachineWindow)
180{
181 /* Make sure this slot is called only under ML and next: */
182 AssertReturnVoid(vboxGlobal().osRelease() > MacOSXRelease_Lion);
183
184 /* Make sure it is NULL or 'this' window passed: */
185 if (pMachineWindow && pMachineWindow != this)
186 return;
187
188 /* Make sure this window has fullscreen logic: */
189 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
190 AssertPtrReturnVoid(pFullscreenLogic);
191
192 /* Mark window 'transitioned from fullscreen': */
193 m_fIsInFullscreenTransition = true;
194
195 /* Exit native fullscreen mode if necessary: */
196 if ( (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
197 && darwinIsInFullscreenMode(this))
198 darwinToggleFullscreenMode(this);
199}
200#endif /* VBOX_WS_MAC */
201
202void UIMachineWindowFullscreen::prepareVisualState()
203{
204 /* Call to base-class: */
205 UIMachineWindow::prepareVisualState();
206
207 /* The background has to go black: */
208 QPalette palette(centralWidget()->palette());
209 palette.setColor(centralWidget()->backgroundRole(), Qt::black);
210 centralWidget()->setPalette(palette);
211 centralWidget()->setAutoFillBackground(true);
212 setAutoFillBackground(true);
213
214#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
215 /* Prepare mini-toolbar: */
216 prepareMiniToolbar();
217#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
218
219#ifdef VBOX_WS_MAC
220 /* Native fullscreen stuff on ML and next: */
221 if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
222 {
223 /* Make sure this window has fullscreen logic: */
224 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
225 AssertPtrReturnVoid(pFullscreenLogic);
226 /* Enable fullscreen support for every screen which requires it: */
227 if (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
228 darwinEnableFullscreenSupport(this);
229 /* Enable transience support for other screens: */
230 else
231 darwinEnableTransienceSupport(this);
232 /* Register to native fullscreen notifications: */
233 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this,
234 UIMachineWindow::handleNativeNotification);
235 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this,
236 UIMachineWindow::handleNativeNotification);
237 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillExitFullScreenNotification", this,
238 UIMachineWindow::handleNativeNotification);
239 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidExitFullScreenNotification", this,
240 UIMachineWindow::handleNativeNotification);
241 UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this,
242 UIMachineWindow::handleNativeNotification);
243}
244#endif /* VBOX_WS_MAC */
245}
246
247#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
248void UIMachineWindowFullscreen::prepareMiniToolbar()
249{
250 /* Make sure mini-toolbar is not restricted: */
251 if (!gEDataManager->miniToolbarEnabled(vboxGlobal().managedVMUuid()))
252 return;
253
254 /* Create mini-toolbar: */
255 m_pMiniToolBar = new UIMiniToolBar(this,
256 GeometryType_Full,
257 gEDataManager->miniToolbarAlignment(vboxGlobal().managedVMUuid()),
258 gEDataManager->autoHideMiniToolbar(vboxGlobal().managedVMUuid()));
259 AssertPtrReturnVoid(m_pMiniToolBar);
260 {
261 /* Configure mini-toolbar: */
262 m_pMiniToolBar->addMenus(actionPool()->menus());
263 connect(m_pMiniToolBar, SIGNAL(sigMinimizeAction()),
264 this, SLOT(showMinimized()), Qt::QueuedConnection);
265 connect(m_pMiniToolBar, SIGNAL(sigExitAction()),
266 actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen), SLOT(trigger()));
267 connect(m_pMiniToolBar, SIGNAL(sigCloseAction()),
268 actionPool()->action(UIActionIndex_M_Application_S_Close), SLOT(trigger()));
269 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutWindowActivationStolen()),
270 this, SLOT(sltRevokeWindowActivation()), Qt::QueuedConnection);
271 }
272}
273#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
274
275#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
276void UIMachineWindowFullscreen::cleanupMiniToolbar()
277{
278 /* Make sure mini-toolbar was created: */
279 if (!m_pMiniToolBar)
280 return;
281
282 /* Save mini-toolbar settings: */
283 gEDataManager->setAutoHideMiniToolbar(m_pMiniToolBar->autoHide(), vboxGlobal().managedVMUuid());
284 /* Delete mini-toolbar: */
285 delete m_pMiniToolBar;
286 m_pMiniToolBar = 0;
287}
288#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
289
290void UIMachineWindowFullscreen::cleanupVisualState()
291{
292#ifdef VBOX_WS_MAC
293 /* Native fullscreen stuff on ML and next: */
294 if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
295 {
296 /* Unregister from native fullscreen notifications: */
297 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this);
298 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this);
299 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillExitFullScreenNotification", this);
300 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidExitFullScreenNotification", this);
301 UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this);
302 }
303#endif /* VBOX_WS_MAC */
304
305#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
306 /* Cleanup mini-toolbar: */
307 cleanupMiniToolbar();
308#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
309
310 /* Call to base-class: */
311 UIMachineWindow::cleanupVisualState();
312}
313
314void UIMachineWindowFullscreen::placeOnScreen()
315{
316 /* Make sure this window has fullscreen logic: */
317 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
318 AssertPtrReturnVoid(pFullscreenLogic);
319
320 /* Get corresponding host-screen: */
321 const int iHostScreen = pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId);
322 /* And corresponding working area: */
323 const QRect workingArea = vboxGlobal().screenGeometry(iHostScreen);
324 Q_UNUSED(workingArea);
325
326#if defined(VBOX_WS_MAC)
327
328 /* Move window to the appropriate position: */
329 move(workingArea.topLeft());
330
331 /* Resize window to the appropriate size on Lion and previous: */
332 if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
333 resize(workingArea.size());
334 /* Resize window to the appropriate size on ML and next if it's screen has no own user-space: */
335 else if (!pFullscreenLogic->screensHaveSeparateSpaces() && m_uScreenId != 0)
336 resize(workingArea.size());
337 else
338 {
339 /* Load normal geometry first of all: */
340 QRect geo = gEDataManager->machineWindowGeometry(UIVisualStateType_Normal, m_uScreenId, vboxGlobal().managedVMUuid());
341 /* If normal geometry is null => use frame-buffer size: */
342 if (geo.isNull())
343 {
344 const UIFrameBuffer *pFrameBuffer = uisession()->frameBuffer(m_uScreenId);
345 geo = QRect(QPoint(0, 0), QSize(pFrameBuffer->width(), pFrameBuffer->height()).boundedTo(workingArea.size()));
346 }
347 /* If normal geometry still null => use default size: */
348 if (geo.isNull())
349 geo = QRect(QPoint(0, 0), QSize(800, 600).boundedTo(workingArea.size()));
350 /* Move window to the center of working-area: */
351 geo.moveCenter(workingArea.center());
352 setGeometry(geo);
353 }
354
355#elif defined(VBOX_WS_WIN)
356
357# if QT_VERSION >= 0x050000
358 /* Map window onto required screen: */
359 windowHandle()->setScreen(qApp->screens().at(iHostScreen));
360# endif /* QT_VERSION >= 0x050000 */
361 /* Set appropriate window size: */
362 resize(workingArea.size());
363# if QT_VERSION < 0x050000
364 /* Move window onto required screen: */
365 move(workingArea.topLeft());
366# endif /* QT_VERSION < 0x050000 */
367
368#elif defined(VBOX_WS_X11)
369
370 /* Determine whether we should use the native full-screen mode: */
371 const bool fUseNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
372 !gEDataManager->legacyFullscreenModeRequested();
373 if (fUseNativeFullScreen)
374 {
375 /* Tell recent window managers which host-screen this window should be mapped to: */
376 VBoxGlobal::setFullScreenMonitorX11(this, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
377 }
378
379 /* Set appropriate window geometry: */
380 resize(workingArea.size());
381 move(workingArea.topLeft());
382
383#else
384
385# warning "port me"
386
387#endif
388}
389
390void UIMachineWindowFullscreen::showInNecessaryMode()
391{
392 /* Make sure window has fullscreen logic: */
393 UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
394 AssertPtrReturnVoid(pFullscreenLogic);
395
396#if defined(VBOX_WS_MAC)
397
398 /* If window shouldn't be shown or mapped to some host-screen: */
399 if (!uisession()->isScreenVisible(m_uScreenId) ||
400 !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
401 {
402 /* Hide window: */
403 hide();
404 }
405 /* If window should be shown and mapped to some host-screen: */
406 else
407 {
408 /* Make sure window have appropriate geometry: */
409 placeOnScreen();
410
411 /* Simple show() for ML and next, showFullScreen() otherwise: */
412 if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
413 show();
414 else
415 showFullScreen();
416
417 /* Adjust machine-view size if necessary: */
418 adjustMachineViewSize();
419
420 /* Make sure machine-view have focus: */
421 m_pMachineView->setFocus();
422 }
423
424#elif defined(VBOX_WS_WIN)
425
426 /* If window shouldn't be shown or mapped to some host-screen: */
427 if (!uisession()->isScreenVisible(m_uScreenId) ||
428 !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
429 {
430 /* Remember whether the window was minimized: */
431 if (isMinimized())
432 m_fWasMinimized = true;
433
434 /* Hide window and reset it's state to NONE: */
435 setWindowState(Qt::WindowNoState);
436 hide();
437 }
438 /* If window should be shown and mapped to some host-screen: */
439 else
440 {
441 /* Check whether window was minimized: */
442 const bool fWasMinimized = isMinimized() && isVisible();
443 /* And reset it's state in such case before exposing: */
444 if (fWasMinimized)
445 setWindowState(Qt::WindowNoState);
446
447 /* Make sure window have appropriate geometry: */
448 placeOnScreen();
449
450 /* Show window: */
451 showFullScreen();
452
453 /* Restore minimized state if necessary: */
454 if (m_fWasMinimized || fWasMinimized)
455 {
456 m_fWasMinimized = false;
457 QMetaObject::invokeMethod(this, "showMinimized", Qt::QueuedConnection);
458 }
459
460 /* Adjust machine-view size if necessary: */
461 adjustMachineViewSize();
462
463 /* Make sure machine-view have focus: */
464 m_pMachineView->setFocus();
465 }
466
467#elif defined(VBOX_WS_X11)
468
469 /* If window shouldn't be shown or mapped to some host-screen: */
470 if (!uisession()->isScreenVisible(m_uScreenId) ||
471 !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
472 {
473 /* Remember whether the window was minimized: */
474 if (isMinimized())
475 m_fWasMinimized = true;
476
477 /* Hide window and reset it's state to NONE: */
478 setWindowState(Qt::WindowNoState);
479 hide();
480 }
481 /* If window should be shown and mapped to some host-screen: */
482 else
483 {
484 /* Check whether window was minimized: */
485 const bool fWasMinimized = isMinimized() && isVisible();
486 /* And reset it's state in such case before exposing: */
487 if (fWasMinimized)
488 setWindowState(Qt::WindowNoState);
489
490 /* Show window: */
491 showFullScreen();
492
493 /* Make sure window have appropriate geometry: */
494 placeOnScreen();
495
496 /* Restore full-screen state after placeOnScreen() call: */
497 setWindowState(Qt::WindowFullScreen);
498
499 /* Restore minimized state if necessary: */
500 if (m_fWasMinimized || fWasMinimized)
501 {
502 m_fWasMinimized = false;
503 QMetaObject::invokeMethod(this, "showMinimized", Qt::QueuedConnection);
504 }
505
506 /* Adjust machine-view size if necessary: */
507 adjustMachineViewSize();
508
509 /* Make sure machine-view have focus: */
510 m_pMachineView->setFocus();
511 }
512
513#else
514
515# warning "port me"
516
517#endif
518}
519
520#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
521void UIMachineWindowFullscreen::updateAppearanceOf(int iElement)
522{
523 /* Call to base-class: */
524 UIMachineWindow::updateAppearanceOf(iElement);
525
526 /* Update mini-toolbar: */
527 if (iElement & UIVisualElement_MiniToolBar)
528 {
529 /* If there is a mini-toolbar: */
530 if (m_pMiniToolBar)
531 {
532 /* Get snapshot(s): */
533 QString strSnapshotName;
534 if (machine().GetSnapshotCount() > 0)
535 {
536 CSnapshot snapshot = machine().GetCurrentSnapshot();
537 strSnapshotName = " (" + snapshot.GetName() + ")";
538 }
539 /* Update mini-toolbar text: */
540 m_pMiniToolBar->setText(machineName() + strSnapshotName);
541 }
542 }
543}
544#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
545
546#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
547void UIMachineWindowFullscreen::changeEvent(QEvent *pEvent)
548{
549 switch (pEvent->type())
550 {
551 case QEvent::WindowStateChange:
552 {
553 /* Watch for window state changes: */
554 QWindowStateChangeEvent *pChangeEvent = static_cast<QWindowStateChangeEvent*>(pEvent);
555 LogRel2(("GUI: UIMachineWindowFullscreen::changeEvent: Window state changed from %d to %d\n",
556 (int)pChangeEvent->oldState(), (int)windowState()));
557 if ( windowState() == Qt::WindowMinimized
558 && pChangeEvent->oldState() == Qt::WindowNoState
559 && !m_fIsMinimized)
560 {
561 /* Mark window minimized, isMinimized() is not enough due to Qt5vsX11 fight: */
562 LogRel2(("GUI: UIMachineWindowFullscreen::changeEvent: Window minimized\n"));
563 m_fIsMinimized = true;
564 }
565 else
566 if ( windowState() == Qt::WindowNoState
567 && pChangeEvent->oldState() == Qt::WindowMinimized
568 && m_fIsMinimized)
569 {
570 /* Mark window restored, and do manual restoring with showInNecessaryMode(): */
571 LogRel2(("GUI: UIMachineWindowFullscreen::changeEvent: Window restored\n"));
572 m_fIsMinimized = false;
573 showInNecessaryMode();
574 }
575 break;
576 }
577 default:
578 break;
579 }
580
581 /* Call to base-class: */
582 UIMachineWindow::changeEvent(pEvent);
583}
584#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
585
586#ifdef VBOX_WS_WIN
587# if QT_VERSION >= 0x050000
588void UIMachineWindowFullscreen::showEvent(QShowEvent *pEvent)
589{
590 /* Expose workaround again,
591 * Qt devs will never fix that it seems.
592 * This time they forget to set 'Mapped'
593 * attribute for initially frame-less window. */
594 setAttribute(Qt::WA_Mapped);
595
596 /* Call to base-class: */
597 UIMachineWindow::showEvent(pEvent);
598}
599# endif /* QT_VERSION >= 0x050000 */
600#endif /* VBOX_WS_WIN */
601
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette