VirtualBox

Changeset 5329 in vbox for trunk/src


Ignore:
Timestamp:
Oct 16, 2007 2:16:43 PM (17 years ago)
Author:
vboxsync
Message:
FE/Qt: Fixed: Don't call QWidgtet::update() from a non-GUI thread on non-DOS platforms since it seems that this method isn't thread safe on X11 in addition to Mac. Also fixed display output inrmode image| on a scrolled virtual display in a smaller comsole window on those platforms.
Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r5132 r5329  
    10511051            }
    10521052
    1053 #ifdef Q_WS_MAC /* see VBoxQImageFrameBuffer::NotifyUpdate. */
     1053#if !defined (Q_WS_WIN) && !defined (Q_WS_PM)
     1054            /* see VBox[QImage|SDL]FrameBuffer::NotifyUpdate(). */
    10541055            case VBoxDefs::RepaintEventType:
    10551056            {
    10561057                VBoxRepaintEvent *re = (VBoxRepaintEvent *) e;
    1057                 viewport()->repaint (re->x(), re->y(), re->width(), re->height(), false);
     1058                viewport()->repaint (re->x() - contentsX(),
     1059                                     re->y() - contentsY(),
     1060                                     re->width(), re->height(), false);
    10581061                /*cconsole.GetDisplay().UpdateCompleted(); - the event was acked already */
    10591062                return true;
    10601063            }
    1061 #endif /* Q_WS_MAC */
     1064#endif
    10621065
    10631066            case VBoxDefs::SetRegionEventType:
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp

    r4255 r5329  
    301301                                                  BOOL *aFinished)
    302302{
    303 #ifdef Q_WS_MAC
    304     /* we're not on the GUI thread and update() isn't thread safe on Qt 3.3.x
    305        on the Mac (4.2.x is), so post the event instead.  */
     303#if !defined (Q_WS_WIN) && !defined (Q_WS_PM)
     304    /* we're not on the GUI thread and update() isn't thread safe in Qt 3.3.x
     305       on the Mac (4.2.x is), on Linux (didn't check Qt 4.x there) and
     306       probably on other non-DOS platforms, so post the event instead. */
    306307    QApplication::postEvent (mView,
    307308                             new VBoxRepaintEvent (aX, aY, aW, aH));
    308 
    309 #else /* !Q_WS_MAC */
     309#else
    310310    /* we're not on the GUI thread, so update() instead of repaint()! */
    311311    mView->viewport()->update (aX - mView->contentsX(),
    312312                               aY - mView->contentsY(),
    313313                               aW, aH);
    314 #endif /* !Q_WS_MAC */
     314#endif
    315315    /* the update has been finished, return TRUE */
    316316    *aFinished = TRUE;
     
    481481                                               BOOL *aFinished)
    482482{
     483#if !defined (Q_WS_WIN) && !defined (Q_WS_PM)
     484    /* we're not on the GUI thread and update() isn't thread safe in Qt 3.3.x
     485       on the Mac (4.2.x is), on Linux (didn't check Qt 4.x there) and
     486       probably on other non-DOS platforms, so post the event instead. */
     487    QApplication::postEvent (mView,
     488                             new VBoxRepaintEvent (aX, aY, aW, aH));
     489#else
    483490    /* we're not on the GUI thread, so update() instead of repaint()! */
    484491    mView->viewport()->update (aX - mView->contentsX(),
    485492                               aY - mView->contentsY(),
    486493                               aW, aH);
     494#endif
    487495    /* the update has been finished, return TRUE */
    488496    *aFinished = TRUE;
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