Skip to content

Conversation

@ptziegler
Copy link
Contributor

At least on Windows and Linux, the operating system doesn't seem to linearly scale the system cursor.

Instead, predefined cursor images are used for:

  • ( ..., 150%) - Cursor at 100% monitor zoom
  • [150%, 200%) - Cursor at 150% monitor zoom
  • (200%, ...) - Cursor at 200% monitor zoom

SWT is linearly scaling the cursor icon. So if at e.g. 125% zoom, the cursor inside the widget will be scaled to 125% zoom but is not scaled outside the widget.

To account for this, the SWT-based cursor is replaced with three cursor SVGs, one for each of those zoom levels. Note that the images are split up to make sure the line width is exactly one for each cursor.

Closes #872

@azoitl
Copy link
Contributor

azoitl commented Nov 26, 2025

should this go into 3.26? or better 3.27.0.M1

@ptziegler
Copy link
Contributor Author

It's only a visual problem that doesn't affect usability. I'm also running some tests right now, so I think it's better suited for the next release.

@ptziegler ptziegler marked this pull request as draft November 26, 2025 10:00
At least on Windows and Linux, the operating system doesn't seem to
linearly scale the system cursor.

Instead, predefined cursor images are used for:

- ( ..., 150%) - Cursor at 100% monitor zoom
- [150%, 200%) - Cursor at 150% monitor zoom
- (200%,  ...) - Cursor at 200% monitor zoom

SWT is linearly scaling the cursor icon. So if at e.g. 125% zoom, the
cursor inside the widget will be scaled to 125% zoom but is not scaled
outside the widget.

To account for this, the SWT-based cursor is replaced with three cursor
SVGs, one for each of those zoom levels. Note that the images are split
up to make sure the line width is exactly one for each cursor.

Closes eclipse-gef#872
@ptziegler
Copy link
Contributor Author

The custom cursors now hopefully follow the same scaling logic as the native Windows cursors. I'm only able to test it up to 200% zoom, but I'm fairly certain the same cursor is used for higher monitor zooms as well.

I still want to try out different ways to decrease anti-aliasing for the SVG because for cursors, crips edges definitely work better.

@ptziegler ptziegler added this to the 3.27.0 milestone Nov 26, 2025
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.

Custom cursors are scaled twice again

2 participants