-
Notifications
You must be signed in to change notification settings - Fork 185
Use OS.CreateIconIndirect for colored cursors with source and mask #2517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
491e76f to
de5bba9
Compare
Test Results 118 files ±0 118 suites ±0 10m 59s ⏱️ +43s For more details on these failures, see this check. Results for commit be1c890. ± Comparison against base commit 810cbcc. ♻️ This comment has been updated with latest results. |
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
Outdated
Show resolved
Hide resolved
de5bba9 to
7b36487
Compare
7b36487 to
f271319
Compare
|
Failing test are unrelated, see #2516 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some concerns about this change:
- It introduces unnecessary complexity to
setupCursorFromIamgeDataas that internal utility method is made capable of handling cases that can not occur (or at least that were also not supported) by the existing API. - It change the return type of
getPointerSizeScaleFactor()without any obvious need, increasing the complexity of consumer code. - The code is not properly formatted.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment was addressed 👍
See Heiko's comments
de48225 to
43cf74d
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java
Outdated
Show resolved
Hide resolved
c9148df to
433b5ba
Compare
Previously, the Cursor constructor that accepted both source and mask used OS.CreateCursor, which only supports monochrome cursors. As a result, any color information in the source was ignored and the cursor always appeared black. This change updates the constructor to use OS.CreateIconIndirect, allowing full-color cursors while still respecting the mask for transparency.DPI scaling of the source and mask now works correctly with colored cursors.
433b5ba to
be1c890
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is fine for me now. I only have two proposals/requests for follow-ups.
|
Follow ups created: vi-eclipse/Eclipse-Platform#461 and vi-eclipse/Eclipse-Platform#462 @fedejeanne |
Use OS.CreateIconIndirect for colored cursors with source and mask
Previously, the Cursor constructor that accepted both source and mask used OS.CreateCursor, which only supports monochrome cursors. As a result, any color information in the source was ignored and the cursor always appeared black.
This change updates the constructor to use OS.CreateIconIndirect, allowing full-color cursors while still respecting the mask for transparency. DPI scaling of the source and mask now works correctly with colored cursors.
How to Test
Run the following snippet:
Snippet386
Cursor(Device, ImageData, ImageData, int, int)value from drop downResult
Before:

After:

Requires