VirtualBox

Changeset 24709 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 17, 2009 9:41:15 AM (15 years ago)
Author:
vboxsync
Message:

Windows guest video driver: report mouse pointer shape only for primary screen (xTracker 4168)

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r23926 r24709  
    15111511        Result = vboxUpdatePointerShape(&PointerAttributes, sizeof (PointerAttributes));
    15121512#else
    1513         Result = vboxUpdatePointerShape(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, &PointerAttributes, sizeof (PointerAttributes));
     1513        Result = vboxUpdatePointerShape((PDEVICE_EXTENSION)HwDeviceExtension, &PointerAttributes, sizeof (PointerAttributes));
    15141514#endif /* VBOX_WITH_HGSMI */
    15151515
     
    17621762                Result = vboxUpdatePointerShape(&PointerAttributes, sizeof (PointerAttributes));
    17631763#else
    1764                 Result = vboxUpdatePointerShape(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, &PointerAttributes, sizeof (PointerAttributes));
     1764                Result = vboxUpdatePointerShape((PDEVICE_EXTENSION)HwDeviceExtension, &PointerAttributes, sizeof (PointerAttributes));
    17651765#endif /* VBOX_WITH_HGSMI */
    17661766
     
    18111811                Result = vboxUpdatePointerShape(pPointerAttributes, RequestPacket->InputBufferLength);
    18121812#else
    1813                 Result = vboxUpdatePointerShape(((PDEVICE_EXTENSION)HwDeviceExtension)->pPrimary, pPointerAttributes, RequestPacket->InputBufferLength);
     1813                Result = vboxUpdatePointerShape((PDEVICE_EXTENSION)HwDeviceExtension, pPointerAttributes, RequestPacket->InputBufferLength);
    18141814#endif /* VBOX_WITH_HGSMI */
    18151815                if (!Result)
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r23793 r24709  
    307307                             PVIDEO_PORT_CONFIG_INFO pConfigInfo,
    308308                             ULONG AdapterMemorySize);
    309 BOOLEAN vboxUpdatePointerShape (PDEVICE_EXTENSION PrimaryExtension,
     309BOOLEAN vboxUpdatePointerShape (PDEVICE_EXTENSION DeviceExtension,
    310310                                PVIDEO_POINTER_ATTRIBUTES pointerAttr,
    311311                                uint32_t cbLength);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp

    r23255 r24709  
    900900    p->fu32Flags = pCtx->pPointerAttr->Enable & 0x0000FFFF;
    901901
    902     /* Even if pointer is invisible, we have to pass following data,
    903      * so host could create the pointer with initial status - invisible
    904      */
    905902    p->u32HotX   = (pCtx->pPointerAttr->Enable >> 16) & 0xFF;
    906903    p->u32HotY   = (pCtx->pPointerAttr->Enable >> 24) & 0xFF;
     
    910907    if (p->fu32Flags & VBOX_MOUSE_POINTER_SHAPE)
    911908    {
     909        /* If shape is supplied, then alway create the pointer visible.
     910         * See comments in 'vboxUpdatePointerShape'
     911         */
     912        p->fu32Flags |= VBOX_MOUSE_POINTER_VISIBLE;
     913
    912914        /* Copy the actual pointer data. */
    913915        memcpy (p->au8Data, pCtx->pPointerAttr->Pixels, pCtx->cbData);
     
    929931}
    930932
    931 BOOLEAN vboxUpdatePointerShape (PDEVICE_EXTENSION PrimaryExtension,
     933BOOLEAN vboxUpdatePointerShape (PDEVICE_EXTENSION DeviceExtension,
    932934                                PVIDEO_POINTER_ATTRIBUTES pointerAttr,
    933935                                uint32_t cbLength)
    934936{
     937    PDEVICE_EXTENSION PrimaryExtension = DeviceExtension->pPrimary;
     938
     939    /* In multimonitor case the HW mouse pointer is the same on all screens,
     940     * and Windows calls each display driver with the same pointer data: visible for
     941     * the screen where the pointer is and invisible for other screens.
     942     *
     943     * This driver passes the shape to the host only from primary screen and makes
     944     * the pointer always visible (in vbvaInitMousePointerShape).
     945     *
     946     * The simple solution makes it impossible to create the shape and keep the mouse
     947     * pointer invisible. New shapes will be created visible.
     948     * But:
     949     * 1) VBox frontends actually ignore the visibility flag if VBOX_MOUSE_POINTER_SHAPE
     950     *    is set and always create new pointers visible.
     951     * 2) Windows uses DrvMovePointer to hide the pointer, which will still work.
     952     */
     953
     954    if (DeviceExtension->iDevice != PrimaryExtension->iDevice)
     955    {
     956        dprintf(("vboxUpdatePointerShape: ignore non primary device %d(%d)\n",
     957                 DeviceExtension->iDevice, PrimaryExtension->iDevice));
     958        /* Success. */
     959        return TRUE;
     960    }
     961
    935962    uint32_t cbData = 0;
    936963
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