Skip to content

Commit

Permalink
Fix cursors double-size on Mac and Linux 11
Browse files Browse the repository at this point in the history
See eclipse-gef#354

On Mac and Linux X11 device zoom should always be 100% when creating the ImageData for the cursor.
  • Loading branch information
Phillipus committed Jan 13, 2024
1 parent 586bead commit a2be18b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions org.eclipse.gef/src/org/eclipse/gef/SharedCursors.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.eclipse.swt.graphics.Cursor;

import org.eclipse.jface.resource.ImageDescriptor;

import org.eclipse.core.runtime.Platform;
import org.eclipse.draw2d.Cursors;

import org.eclipse.gef.internal.Internal;
Expand Down Expand Up @@ -70,7 +70,11 @@ private static int getDeviceZoom() {
}
}
}
return deviceZoom;
// On Mac and Linux X11 ImageData for cursors should always be created with 100% device zoom
return Platform.getOS().equals(Platform.OS_MACOSX) ||
(Platform.getOS().equals(Platform.OS_LINUX) && "x11".equalsIgnoreCase(System.getenv("XDG_SESSION_TYPE"))) //$NON-NLS-1$ //$NON-NLS-2$
? 100
: deviceZoom;
}

}

0 comments on commit a2be18b

Please sign in to comment.