VirtualBox

Changeset 37889 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Jul 12, 2011 11:18:46 AM (14 years ago)
Author:
vboxsync
Message:

wddm: mouse pointer for multimon fix, shared resource optimize

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r37626 r37889  
    7070typedef struct _VBOXWDDM_GLOBAL_POINTER_INFO
    7171{
     72    uint32_t iLastReportedScreen;
    7273    uint32_t cVisible;
    7374} VBOXWDDM_GLOBAL_POINTER_INFO, *PVBOXWDDM_GLOBAL_POINTER_INFO;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r37736 r37889  
    34213421    PVBOXWDDM_GLOBAL_POINTER_INFO pGlobalPointerInfo = &pDevExt->PointerInfo;
    34223422    PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = &pPointerInfo->Attributes.data;
    3423     BOOLEAN bNotifyVisibility;
     3423    BOOLEAN fScreenVisState = !!(pPointerAttributes->Enable & VBOX_MOUSE_POINTER_VISIBLE);
     3424    BOOLEAN fVisStateChanged = FALSE;
     3425    BOOLEAN fScreenChanged = pGlobalPointerInfo->iLastReportedScreen != pSetPointerPosition->VidPnSourceId;
     3426
    34243427    if (pSetPointerPosition->Flags.Visible)
    34253428    {
    3426         bNotifyVisibility = (pGlobalPointerInfo->cVisible == 0);
    3427         if (!(pPointerAttributes->Enable & VBOX_MOUSE_POINTER_VISIBLE))
    3428         {
     3429        pPointerAttributes->Enable |= VBOX_MOUSE_POINTER_VISIBLE;
     3430        if (!fScreenVisState)
     3431        {
     3432            fVisStateChanged = !!pGlobalPointerInfo->cVisible;
    34293433            ++pGlobalPointerInfo->cVisible;
    3430             pPointerAttributes->Enable |= VBOX_MOUSE_POINTER_VISIBLE;
    34313434        }
    34323435    }
    34333436    else
    34343437    {
    3435         if (!!(pPointerAttributes->Enable & VBOX_MOUSE_POINTER_VISIBLE))
     3438        pPointerAttributes->Enable &= ~VBOX_MOUSE_POINTER_VISIBLE;
     3439        if (fScreenVisState)
    34363440        {
    34373441            --pGlobalPointerInfo->cVisible;
    3438             Assert(pGlobalPointerInfo->cVisible < UINT32_MAX/2);
    3439             pPointerAttributes->Enable &= ~VBOX_MOUSE_POINTER_VISIBLE;
    3440             bNotifyVisibility = (pGlobalPointerInfo->cVisible == 0);
    3441         }
    3442     }
    3443 
    3444     pPointerAttributes->Column = pSetPointerPosition->X;
    3445     pPointerAttributes->Row = pSetPointerPosition->Y;
    3446 
    3447     if (bNotifyVisibility && VBoxQueryHostWantsAbsolute())
    3448     {
    3449         // tell the host to use the guest's pointer
    3450         VIDEO_POINTER_ATTRIBUTES PointerAttributes;
    3451 
    3452         /* Visible and No Shape means Show the pointer.
    3453          * It is enough to init only this field.
    3454          */
    3455         PointerAttributes.Enable = pSetPointerPosition->Flags.Visible ? VBOX_MOUSE_POINTER_VISIBLE : 0;
    3456 
    3457         BOOLEAN bResult = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &PointerAttributes, sizeof (PointerAttributes));
    3458         Assert(bResult);
     3442            fVisStateChanged = !!pGlobalPointerInfo->cVisible;
     3443        }
     3444    }
     3445
     3446    pGlobalPointerInfo->iLastReportedScreen = pSetPointerPosition->VidPnSourceId;
     3447
     3448    if ((fVisStateChanged || fScreenChanged) && VBoxQueryHostWantsAbsolute())
     3449    {
     3450        if (fScreenChanged)
     3451        {
     3452            BOOLEAN bResult = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE);
     3453            Assert(bResult);
     3454        }
     3455        else
     3456        {
     3457            // tell the host to use the guest's pointer
     3458            VIDEO_POINTER_ATTRIBUTES PointerAttributes;
     3459
     3460            /* Visible and No Shape means Show the pointer.
     3461             * It is enough to init only this field.
     3462             */
     3463            PointerAttributes.Enable = pSetPointerPosition->Flags.Visible ? VBOX_MOUSE_POINTER_VISIBLE : 0;
     3464
     3465            BOOLEAN bResult = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &PointerAttributes, sizeof (PointerAttributes));
     3466            Assert(bResult);
     3467        }
    34593468    }
    34603469
     
    34853494        if (vboxVddmPointerShapeToAttributes(pSetPointerShape, pPointerInfo))
    34863495        {
     3496            pDevExt->PointerInfo.iLastReportedScreen = pSetPointerShape->VidPnSourceId;
    34873497            if (VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE))
    34883498                Status = STATUS_SUCCESS;
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