VirtualBox

Changeset 35148 in vbox


Ignore:
Timestamp:
Dec 15, 2010 4:32:14 PM (14 years ago)
Author:
vboxsync
Message:

Main/Display: take into account disabled screens for pointer reporting

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r35047 r35148  
    617617 */
    618618int Display::handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM,
    619                                   uint32_t cbLine, int w, int h)
     619                                  uint32_t cbLine, int w, int h, uint16_t flags)
    620620{
    621621    LogRel (("Display::handleDisplayResize(): uScreenId = %d, pvVRAM=%p "
    622              "w=%d h=%d bpp=%d cbLine=0x%X\n",
    623              uScreenId, pvVRAM, w, h, bpp, cbLine));
     622             "w=%d h=%d bpp=%d cbLine=0x%X, flags=0x%X\n",
     623             uScreenId, pvVRAM, w, h, bpp, cbLine, flags));
    624624
    625625    /* If there is no framebuffer, this call is not interesting. */
     
    635635    mLastWidth = w;
    636636    mLastHeight = h;
     637    mLastFlags = flags;
    637638
    638639    ULONG pixelFormat;
     
    675676        maFramebuffers[uScreenId].pendingResize.w           = w;
    676677        maFramebuffers[uScreenId].pendingResize.h           = h;
     678        maFramebuffers[uScreenId].pendingResize.flags       = flags;
    677679
    678680        return VINF_VGA_RESIZE_IN_PROGRESS;
     
    739741            pFBInfo->pendingResize.fPending = false;
    740742            handleDisplayResize (uScreenId, pFBInfo->pendingResize.bpp, pFBInfo->pendingResize.pvVRAM,
    741                                  pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h);
     743                                 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h, pFBInfo->pendingResize.flags);
    742744            continue;
    743745        }
     
    946948    if (!mpDrv)
    947949        return;
    948     x2 = mpDrv->IConnector.cx + maFramebuffers[0].xOrigin;
    949     y2 = mpDrv->IConnector.cy + maFramebuffers[0].yOrigin;
     950    /* If VBVA is not in use then maFramebuffers will be zeroed out and this
     951     * will still work as it should. */
     952    if (!(maFramebuffers[0].flags & VBVA_SCREEN_F_DISABLED))
     953    {
     954        x2 = mpDrv->IConnector.cx + (int32_t)maFramebuffers[0].xOrigin;
     955        y2 = mpDrv->IConnector.cy + (int32_t)maFramebuffers[0].yOrigin;
     956    }
    950957    for (unsigned i = 1; i < mcMonitors; ++i)
    951958    {
    952         x1 = RT_MIN(x1, maFramebuffers[i].xOrigin);
    953         y1 = RT_MIN(y1, maFramebuffers[i].yOrigin);
    954         x2 = RT_MAX(x2, maFramebuffers[i].xOrigin + (int32_t)maFramebuffers[i].w);
    955         y2 = RT_MAX(y2, maFramebuffers[i].yOrigin + (int32_t)maFramebuffers[i].h);
     959        if (!(maFramebuffers[i].flags & VBVA_SCREEN_F_DISABLED))
     960        {
     961            x1 = RT_MIN(x1, maFramebuffers[i].xOrigin);
     962            y1 = RT_MIN(y1, maFramebuffers[i].yOrigin);
     963            x2 = RT_MAX(x2,   maFramebuffers[i].xOrigin
     964                            + (int32_t)maFramebuffers[i].w);
     965            y2 = RT_MAX(y2,   maFramebuffers[i].yOrigin
     966                            + (int32_t)maFramebuffers[i].h);
     967        }
    956968    }
    957969    *px1 = x1;
     
    29923004                                      pFBInfo->u32LineSize,
    29933005                                      pFBInfo->w,
    2994                                       pFBInfo->h);
     3006                                      pFBInfo->h,
     3007                                      pFBInfo->flags);
    29953008        }
    29963009        else if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     
    30013014                                      that->mLastBytesPerLine,
    30023015                                      that->mLastWidth,
    3003                                       that->mLastHeight);
     3016                                      that->mLastHeight,
     3017                                      that->mLastFlags);
    30043018        }
    30053019    }
     
    30223036                  bpp, pvVRAM, cbLine, cx, cy));
    30233037
    3024     return pDrv->pDisplay->handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy);
     3038    return pDrv->pDisplay->handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy, VBVA_SCREEN_F_ACTIVE);
    30253039}
    30263040
     
    34343448            {
    34353449                /* Primary screen resize is initiated by the VGA device. */
    3436                 pDrv->pDisplay->handleDisplayResize(uScreenId, pScreen->bitsPerPixel, (uint8_t *)pvVRAM + pFBInfo->u32Offset, pScreen->u32LineSize, pScreen->u16Width, pScreen->u16Height);
     3450                pDrv->pDisplay->handleDisplayResize(uScreenId, pScreen->bitsPerPixel, (uint8_t *)pvVRAM + pFBInfo->u32Offset, pScreen->u32LineSize, pScreen->u16Width, pScreen->u16Height, VBVA_SCREEN_F_ACTIVE);
    34373451            }
    34383452        }
     
    38593873    pFBInfo->u32LineSize = pScreen->u32LineSize;
    38603874
     3875    pFBInfo->flags = pScreen->u16Flags;
     3876
    38613877    if (fNewOrigin)
    38623878    {
     
    38993915    return pThis->handleDisplayResize(pScreen->u32ViewIndex, pScreen->u16BitsPerPixel,
    39003916                                      (uint8_t *)pvVRAM + pScreen->u32StartOffset,
    3901                                       pScreen->u32LineSize, pScreen->u32Width, pScreen->u32Height);
     3917                                      pScreen->u32LineSize, pScreen->u32Width, pScreen->u32Height, pScreen->u16Flags);
    39023918}
    39033919
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r34754 r35148  
    5353    uint32_t u32LineSize;
    5454
     55    uint16_t flags;
     56
    5557    VBOXVIDEOINFOHOSTEVENTS *pHostEvents;
    5658
     
    7678        int w;
    7779        int h;
     80        uint16_t flags;
    7881    } pendingResize;
    7982
     
    122125
    123126    // public methods only for internal purposes
    124     int handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, int w, int h);
     127    int handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, int w, int h, uint16_t flags);
    125128    void handleDisplayUpdateLegacy (int x, int y, int cx, int cy);
    126129    void handleDisplayUpdate (unsigned uScreenId, int x, int y, int w, int h);
     
    243246    int mLastWidth;
    244247    int mLastHeight;
     248    uint16_t mLastFlags;
    245249
    246250    VBVAMEMORY *mpVbvaMemory;
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