gef-classic icon indicating copy to clipboard operation
gef-classic copied to clipboard

Giant cursors on Macbook with retina display

Open kysmith-csg opened this issue 1 year ago • 6 comments

Hello, I think this must be new as a result of the latest cursor updates, but the custom gef cursors are huge now on high-resolution displays (at least for Macs).

Normal cursor: normalcursor

Giant plug cursor: giantplug

Giant add cursor: giantadd

GEF is correctly loading the 2x versions of the cursors, but it seems that they are not being displayed in the correct size. I.e., a 2x version of a 16 bit icon should take up the same amount of physical screen space on a retina display as a 1x 16 bit icon on a normal display, not just be twice as big.

I'm not very familiar with cursors. Are they designed to scale with the display resolution?


Eclipse GEF GEF Classic Draw2d 3.14.100.202311222042 org.eclipse.draw2d Eclipse GEF GEF Classic GEF (MVC) 3.16.0.202311222042 org.eclipse.gef

Macbook Pro 2021 macOS Sonoma 14.2.1 16" Retina (resolution 3456 x 2234) Apple M1 Max

kysmith-csg avatar Jan 12 '24 19:01 kysmith-csg

The problem is here:

https://github.com/eclipse/gef-classic/blob/586bead1bb52bba21210349ab6be90d4f11780aa/org.eclipse.gef/src/org/eclipse/gef/SharedCursors.java#L56-L74

On Mac and Linux X11 the device zoom for cursors should always be 100. On Windows and Linux Wayland the device zoom for cursors should be as reported.

This is how I implemented it in Archi:

https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor/src/com/archimatetool/editor/diagram/tools/ExtCombinedTemplateCreationEntry.java

and

https://github.com/archimatetool/archi/blob/b5a2eef733d7c3a933d69f58d6452274ae0a5842/com.archimatetool.editor/src/com/archimatetool/editor/ui/ImageFactory.java#L72-L80

Phillipus avatar Jan 13 '24 10:01 Phillipus

So a check needs to added in getDeviceZoom to return 100 if on Mac or Linux X11.

Phillipus avatar Jan 13 '24 10:01 Phillipus

Created PR https://github.com/eclipse/gef-classic/pull/356

Phillipus avatar Jan 13 '24 11:01 Phillipus

@kysmith-csg Can you test the latest code to see if this fixes the issue?

Phillipus avatar Jan 15 '24 11:01 Phillipus

@Phillipus thank you for the very quick fix! With the nightly build it seems to be fixed. Looks much more normal now!

normal add plug

(is it just me or is the + cursor bigger than the others?)

Eclipse GEF GEF Classic GEF (MVC) 3.17.0.202401141938 org.eclipse.gef Eclipse GEF GEF Classic Draw2d 3.15.0.202401141938 org.eclipse.draw2d

kysmith-csg avatar Jan 16 '24 14:01 kysmith-csg

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Sep 12 '24 01:09 github-actions[bot]

This issue was closed because it has been inactive for 180 days since being marked as stale.

github-actions[bot] avatar Mar 11 '25 02:03 github-actions[bot]

@azoitl this is resolved now yes? Unless those changes didn't make it in?

Note that I haven't specifically tested it, although I haven't noticed them being huge.

cc @Phillipus

kysmith-csg avatar Mar 13 '25 14:03 kysmith-csg

@kysmith-csg thx for coming back to us for that. @Phillipus fix is in GEF Classic since 3.19. I guess as in your last message you where not fully sure if it is fixed or not we still haven't closed the issue. But if you are fine I would just close it.

azoitl avatar Mar 13 '25 16:03 azoitl