VirtualBox

Changeset 36016 in vbox


Ignore:
Timestamp:
Feb 17, 2011 3:28:12 PM (14 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: never send resolutions that older VBox versions can not handle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r35949 r36016  
    12771277{
    12781278    VBOXPtr pVBox = VBOXGetRec(pScrn);
    1279     Bool rc = TRUE, fActive = !pVBox->afDisabled[cDisplay];
    12801279    uint32_t offStart, cwReal = cWidth;
    12811280
     
    12921291    if (   offStart + pVBox->cbLine * cHeight > pVBox->cbFBMax
    12931292        || pVBox->cbLine * pScrn->virtualY > pVBox->cbFBMax)
    1294         fActive = FALSE;
     1293        return FALSE;
    12951294    /* Deactivate the screen if it is outside of the virtual framebuffer and
    12961295     * clamp it to lie inside if it is partly outside. */
    12971296    if (x >= pScrn->displayWidth || x + (int) cWidth <= 0)
    1298         fActive = FALSE;
     1297        return FALSE;
    12991298    else
    13001299        cwReal = RT_MIN((int) cWidth, pScrn->displayWidth - x);
    1301     TRACE_LOG("pVBox->afDisabled[cDisplay]=%d, fActive=%d\n",
    1302               (int)pVBox->afDisabled[cDisplay], (int)fActive);
     1300    TRACE_LOG("pVBox->afDisabled[cDisplay]=%d\n",
     1301              (int)pVBox->afDisabled[cDisplay]);
    13031302    /* Don't fiddle with the hardware if we are switched
    13041303     * to a virtual terminal. */
    1305     if (!pVBox->vtSwitch && fActive)
     1304    if (pVBox->vtSwitch)
     1305        return TRUE;
     1306    if (cDisplay == 0)
     1307        VBoxVideoSetModeRegisters(cwReal, cHeight, pScrn->displayWidth,
     1308                                  vboxBPP(pScrn), 0, x, y);
     1309    /* Tell the host we support graphics */
     1310    if (vbox_device_available(pVBox))
     1311        vboxEnableGraphicsCap(pVBox);
     1312    if (pVBox->fHaveHGSMI)
    13061313    {
    1307         if (cDisplay == 0)
    1308             VBoxVideoSetModeRegisters(cwReal, cHeight, pScrn->displayWidth,
    1309                                       vboxBPP(pScrn), 0, x, y);
    1310         /* Tell the host we support graphics */
    1311         if (vbox_device_available(pVBox))
    1312             vboxEnableGraphicsCap(pVBox);
    1313     }
    1314     if (   (pVBox->fHaveHGSMI)
    1315         && !pVBox->vtSwitch)
     1314        uint16_t fFlags = VBVA_SCREEN_F_ACTIVE;
     1315        fFlags |= (pVBox->afDisabled[cDisplay] ? VBVA_SCREEN_F_DISABLED : 0);
    13161316        VBoxHGSMIProcessDisplayInfo(&pVBox->guestCtx, cDisplay, x, y,
    13171317                                    offStart, pVBox->cbLine, cwReal, cHeight,
    1318                                     vboxBPP(pScrn),
    1319                                       VBVA_SCREEN_F_ACTIVE
    1320                                     | (fActive ? 0: VBVA_SCREEN_F_DISABLED));
    1321     TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE");
    1322     return rc;
     1318                                    vboxBPP(pScrn), fFlags);
     1319    }
     1320    return TRUE;
    13231321}
    13241322
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