-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Labels
HiDPIIssues related to High resolution monitorsIssues related to High resolution monitorsWindowsHappens on Windows OSHappens on Windows OS
Description
Related to eclipse-platform/eclipse.platform.ui#3047 and #2308 but not quite the same.
On a monitor with 150% zoom, consider the following snippet:
package test;
import java.io.InputStream;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Snippet {
public static void main(String[] args) {
System.setProperty("swt.autoScale.updateOnRuntime", "true");
Cursor cursor = new Cursor(null, getImageData(100), 0, 0);
Shell shell = new Shell(SWT.NO_TRIM);
shell.setSize(100, 100);
shell.setCursor(cursor);
shell.setBackground(new Color(0, 255, 0));
shell.open();
Display display = shell.getDisplay();
while (!display.isDisposed()){
display.readAndDispatch();
}
cursor.dispose();
}
private static ImageData getImageData(int zoom) {
try (InputStream is = Snippet.class.getResourceAsStream("Seg_Add.png")) {
ImageLoader imageLoader = new ImageLoader();
return imageLoader.load(is)[0];
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
What I expect (see the other bug for the wrong scaling, otherwise this, except 50% larger):

What I get:

Tested with the 3.131.0.v20250709-1347.
Metadata
Metadata
Assignees
Labels
HiDPIIssues related to High resolution monitorsIssues related to High resolution monitorsWindowsHappens on Windows OSHappens on Windows OS