VirtualBox

Changeset 59814 in vbox


Ignore:
Timestamp:
Feb 25, 2016 11:20:12 AM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Qt5 migration (part 98): Workaround for full-screen/seamless modes, Qt5 somehow forgets to init windows as mapped if they initially shown as frameless, that freezes any painting at all.

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

Legend:

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

    r58866 r59814  
    232232        UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this,
    233233                                                                       UIMachineWindow::handleNativeNotification);
    234     }
     234}
    235235#endif /* Q_WS_MAC */
    236236}
     
    483483#endif /* Q_WS_WIN || Q_WS_X11 */
    484484
     485#ifdef Q_WS_WIN
     486# if QT_VERSION >= 0x050000
     487void UIMachineWindowFullscreen::showEvent(QShowEvent *pEvent)
     488{
     489    /* Expose workaround again,
     490     * Qt devs will never fix that it seems.
     491     * This time they forget to set 'Mapped'
     492     * attribute for initially frame-less window. */
     493    setAttribute(Qt::WA_Mapped);
     494
     495    /* Call to base-class: */
     496    UIMachineWindow::showEvent(pEvent);
     497}
     498# endif /* QT_VERSION >= 0x050000 */
     499#endif /* Q_WS_WIN */
     500
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r57050 r59814  
    102102#endif /* Q_WS_WIN || Q_WS_X11 */
    103103
     104#ifdef Q_WS_WIN
     105# if QT_VERSION >= 0x050000
     106    /** Win: Handles show @a pEvent. */
     107    void showEvent(QShowEvent *pEvent);
     108# endif /* QT_VERSION >= 0x050000 */
     109#endif /* Q_WS_WIN */
     110
    104111#if defined(Q_WS_WIN) || defined(Q_WS_X11)
    105112    /** Holds the mini-toolbar instance. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r57591 r59814  
    267267#endif /* Q_WS_WIN || Q_WS_X11 */
    268268
    269 #if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS) && defined(Q_WS_WIN)
    270 void UIMachineWindowSeamless::showEvent(QShowEvent *pShowEvent)
    271 {
    272     /* Call to base class: */
    273     UIMachineWindow::showEvent(pShowEvent);
    274 
    275     /* Following workaround allows to fix the next Qt BUG:
    276      * https://bugreports.qt-project.org/browse/QTBUG-17548
    277      * https://bugreports.qt-project.org/browse/QTBUG-30974
    278      * Widgets with Qt::WA_TranslucentBackground attribute
    279      * stops repainting after minimizing/restoring, we have to call for single update. */
    280     QApplication::postEvent(this, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
    281 }
    282 #endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS && Q_WS_WIN */
     269#ifdef Q_WS_WIN
     270# if QT_VERSION >= 0x050000
     271void UIMachineWindowSeamless::showEvent(QShowEvent *pEvent)
     272{
     273    /* Expose workaround again,
     274     * Qt devs will never fix that it seems.
     275     * This time they forget to set 'Mapped'
     276     * attribute for initially frame-less window. */
     277    setAttribute(Qt::WA_Mapped);
     278
     279    /* Call to base-class: */
     280    UIMachineWindow::showEvent(pEvent);
     281}
     282# endif /* QT_VERSION >= 0x050000 */
     283#endif /* Q_WS_WIN */
    283284
    284285#ifdef VBOX_WITH_MASKED_SEAMLESS
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r57050 r59814  
    7474#endif /* Q_WS_WIN || Q_WS_X11 */
    7575
    76 #if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS) && defined(Q_WS_WIN)
    77     /** Windows: Translucency stuff workaround. */
     76#ifdef Q_WS_WIN
     77# if QT_VERSION >= 0x050000
     78    /** Win: Handles show @a pEvent. */
    7879    void showEvent(QShowEvent *pEvent);
    79 #endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS && Q_WS_WIN */
     80# endif /* QT_VERSION >= 0x050000 */
     81#endif /* Q_WS_WIN */
    8082
    8183#ifdef VBOX_WITH_MASKED_SEAMLESS
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