Skip to content

Unify Cursor Drawing for ImageDataWithMaskCursorHandleProvider and ImageDataCursorHandleProvider #441

@ShahzaibIbrahim

Description

@ShahzaibIbrahim

Description
Currently, ImageDataWithMaskCursorHandleProvider uses OS.CreateCursor to draw the cursor while ImageDataCursorHandleProvider uses OS.CreateIconIndirect.

OS.CreateCursor creates a monochrome cursor having the specified size, bit patterns, and hot spot and currently we cannot create a colored cursor while providing source and mask and during the DPI change it's not scaling upto expected value.

As you can see in the gif below, I have a primary monitor at 150% and secondary monitor at 200% with a base cursor image size of 16. Expected size at 200% is 32px but using Cursor(Device, ImageData, ImageData, int, int) cursor is giving us the size of ~40px. Also the color set with a passed source is RGB(0, 255, 0) which is green but it's not taken into consideration here and drawn black.

Image

Expected Behavior
The cursor should scale as per expected value shown and should adhere to color set for source image data.

Necessary configuration:
Use Snippet386 to test the changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HiDPIA HiDPI-Related Issue or FeatureSWTIssue for SWT

    Type

    Projects

    Status

    ✅ Approved

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions