Skip to content

Commit aabcb5b

Browse files
Update N&N: Clarify rationale for Cursor constructor deprecation in SWT
- Updated the news and noteworthy entry for the deprecation of `Cursor(Device, ImageData, ImageData, int, int)` in SWT. - Clarified that the constructor was deprecated due to limited DPI support. - Explained that the new `Cursor(Device, ImageDataProvider, int, int)` constructor provides the best image for all zoom levels, ensuring proper support for high-DPI displays.
1 parent 53d0364 commit aabcb5b

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

news/4.38/platform_isv.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@ A special thanks to everyone who [contributed to Eclipse-Platform](acknowledgeme
77
## Platform Changes
88
-->
99

10-
<!--
11-
---
10+
1211
## SWT Changes
13-
-->
12+
13+
### Cursor Constructor Deprecation and Replacement
14+
15+
<details>
16+
<summary>Contributors</summary>
17+
18+
- [Shahzaib Ibrahim](https://github.com/ShahzaibIbrahim)
19+
</details>
20+
21+
The constructor `Cursor(Device, ImageData, ImageData, int, int)` has been **deprecated** in SWT due to its limited DPI support. This constructor 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.
22+
23+
However, this approach has become uncommon, as modern practices typically encode mask data directly into the image data itself (for example, by using alpha channels).
24+
25+
We could either use `Cursor(Device, ImageData, ImageData, int, int)`. This constructor that accepts a single `ImageData` object (containing both the image and mask information) is **not** deprecated since the mask data is directly encoded into the image and as a user you don't need to define mask pixel by pixel.
26+
27+
The **recommended** constructor to use is `Cursor(Device, ImageDataProvider, int, int)` as it ensures the best possible image for a cursor at all zoom levels.
28+
29+
**Action Required:**
30+
Please update your code to use the **recommended** constructor for better compatibility and future-proofing.

0 commit comments

Comments
 (0)