VirtualBox

Changeset 46256 in vbox for trunk/src


Ignore:
Timestamp:
May 24, 2013 3:57:03 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6749: Runtime UI: Some seamless/fullscreen modes cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r46244 r46256  
    2222#include <QMenu>
    2323#include <QTimer>
    24 #ifdef Q_WS_MAC
    25 # include <QMenuBar>
    26 #endif /* Q_WS_MAC */
    2724
    2825/* GUI includes: */
     
    180177            if (pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
    181178            {
    182                 /* Make sure the window is placed on valid screen
    183                  * before we are show fullscreen window: */
     179                /* Make sure the window is maximized and placed on valid screen: */
    184180                placeOnScreen();
    185181
     
    193189#endif /* Q_WS_WIN */
    194190
    195                 /* Show window fullscreen: */
     191                /* Show in fullscreen mode: */
    196192                showFullScreen();
    197193
    198194                /* Make sure the window is placed on valid screen again
    199195                 * after window is shown & window's decorations applied.
    200                  * That is required due to X11 Window Geometry Rules. */
     196                 * That is required (still?) due to X11 Window Geometry Rules. */
    201197                placeOnScreen();
    202 
    203 #ifdef Q_WS_MAC
    204                 /* Make sure it is really on the right place (especially on the Mac): */
    205                 QRect r = QApplication::desktop()->screenGeometry(qobject_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId));
    206                 move(r.topLeft());
    207 #endif /* Q_WS_MAC */
    208198
    209199                /* Return early: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r46255 r46256  
    2222#include <QMenu>
    2323#include <QTimer>
    24 #ifdef Q_WS_MAC
    25 # include <QMenuBar>
    26 #endif /* Q_WS_MAC */
    2724
    2825/* GUI includes: */
     
    8784    UIMachineWindow::prepareVisualState();
    8885
     86    /* Make sure we have no background
     87     * until the first one paint-event: */
     88    setAttribute(Qt::WA_NoSystemBackground);
     89
    8990#ifdef Q_WS_WIN
    90     /* Enable translucent background for Win host,
    91      * Mac host has it native, Qt 4.8.3 under x11 host has is broken: */
     91    /* Using Qt API to enable translucent background for the Win host.
     92     * - Under Mac host Qt doesn't allows to disable window-shadows
     93     *   until version 4.8, but minimum supported version is 4.7.1 for now.
     94     * - Under x11 host Qt 4.8.3 has it broken wih KDE 4.9 for now: */
    9295    setAttribute(Qt::WA_TranslucentBackground);
    9396#endif /* Q_WS_WIN */
    9497
    9598#ifdef Q_WS_MAC
    96     /* Please note: All the stuff below has to be done after the window has
    97      * switched to fullscreen. Qt changes the winId on the fullscreen
    98      * switch and make this stuff useless with the old winId. So please be
    99      * careful on rearrangement of the method calls. */
     99    /* Using native API to enable translucent background for the Mac host.
     100     * - We also want to disable window-shadows which is possible
     101     *   using Qt::WA_MacNoShadow only since Qt 4.8,
     102     *   while minimum supported version is 4.7.1 for now: */
    100103    ::darwinSetShowsWindowTransparent(this, true);
    101104#endif /* Q_WS_MAC */
     
    159162{
    160163#ifndef Q_WS_MAC
    161     /* Cleeanup mini-toolbar: */
     164    /* Cleanup mini-toolbar: */
    162165    cleanupMiniToolbar();
    163166#endif /* !Q_WS_MAC */
     
    207210            if (pSeamlessLogic->hasHostScreenForGuestScreen(m_uScreenId))
    208211            {
    209                 /* Show manually maximized window: */
     212                /* Make sure the window is maximized and placed on valid screen: */
    210213                placeOnScreen();
    211214
    212                 /* Show normal window: */
     215                /* Show in normal mode: */
    213216                show();
    214 
    215 #ifdef Q_WS_MAC
    216                 /* Make sure it is really on the right place (especially on the Mac): */
    217                 QRect r = vboxGlobal().availableGeometry(qobject_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId));
    218                 move(r.topLeft());
    219 #endif /* Q_WS_MAC */
    220217
    221218                /* Return early: */
     
    254251}
    255252#endif /* !Q_WS_MAC */
    256 
    257 #ifdef Q_WS_MAC
    258 bool UIMachineWindowSeamless::event(QEvent *pEvent)
    259 {
    260     switch (pEvent->type())
    261     {
    262         case QEvent::Paint:
    263         {
    264             /* Clear the background */
    265             CGContextClearRect(::darwinToCGContextRef(this), ::darwinToCGRect(frameGeometry()));
    266             break;
    267         }
    268         default:
    269             break;
    270     }
    271     return UIMachineWindow::event(pEvent);
    272 }
    273 #endif /* Q_WS_MAC */
    274253
    275254#ifdef Q_WS_WIN
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r46255 r46256  
    7474#endif /* !Q_WS_MAC */
    7575
    76 #ifdef Q_WS_MAC
    77     /* Event handlers: */
    78     bool event(QEvent *pEvent);
    79 #endif /* Q_WS_MAC */
    80 
    8176#ifdef Q_WS_WIN
    8277    /* Handler: Translucency stuff: */
Note: See TracChangeset for help on using the changeset viewer.

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