Skip to content

Conversation

ShahzaibIbrahim
Copy link
Contributor

The constructor Cursor(Device, ImageData source, ImageData mask, int hotspotX, int hotspotY) allows creating a cursor by providing a source image and a 1-bit mask to define transparency. This approach requires developers to manually define mask pixels and works reliably only in fixed DPI environments.

With the introduction of multi-monitor DPI support, this constructor produces inconsistent results.

  • Masks do not scale properly when using DPIUtil.autoScaleImageData, leading to visual artifacts.
  • Developers need to handle scaling and mask adjustments manually, which is error-prone.

Copy link
Contributor

github-actions bot commented Sep 30, 2025

Test Results

  118 files  ±0    118 suites  ±0   9m 55s ⏱️ - 1m 12s
4 583 tests ±0  4 547 ✅ ±0  36 💤 ±0  0 ❌ ±0 
  330 runs  ±0    307 ✅ ±0  23 💤 ±0  0 ❌ ±0 

Results for commit 67bbb41. ± Comparison against base commit 48e5878.

♻️ This comment has been updated with latest results.

Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahzaibIbrahim is it possible to replace the remaining usages of the deprecated methods? There are 5 new warnings (see failing checks)

@ShahzaibIbrahim
Copy link
Contributor Author

@fedejeanne those warnings are all from the test. What I can do now is to suppress the warning for deprecation on those test.

The constructor Cursor(Device, ImageData source, ImageData mask, int
hotspotX, int hotspotY) allows creating a cursor by providing a source
image and a 1-bit mask to define transparency. This approach requires
developers to manually define mask pixels and works reliably only in
fixed DPI environments.recommended to use: Cursor(Device device,
ImageDataProvider imageDataProvider, int hotspotX, int hotspotY).
@fedejeanne fedejeanne merged commit 0e04bc9 into eclipse-platform:master Oct 2, 2025
17 checks passed
@fedejeanne fedejeanne deleted the master-462 branch October 2, 2025 08:44
@akurtakov
Copy link
Member

It is a good practice before deprecating some method to go through Eclipse TLP codebase and switch to new way. Otherwise we end up with pile of deprecation warnings that make working on the codebase a nightmare. E.g. https://github.com/eclipse-platform/eclipse.platform.ui/pull/3278/checks?check_run_id=51871277212 . Can I count on you doing this work?

akurtakov added a commit to akurtakov/eclipse.platform.ui that referenced this pull request Oct 3, 2025
Stop pointing to deprecated Cursor constructors in
eclipse-platform/eclipse.platform.swt#2563
akurtakov added a commit to eclipse-platform/eclipse.platform.ui that referenced this pull request Oct 3, 2025
Stop pointing to deprecated Cursor constructors in
eclipse-platform/eclipse.platform.swt#2563
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation Request: Cursor(Device, ImageData, ImageData, int, int)
3 participants