Bug 581656 - SWT_AWT shouldn't autoscale
Summary: SWT_AWT shouldn't autoscale
Status: NEW
Alias: None
Product: Incubator
Classification: Eclipse Project
Component: e4 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: E4 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-12 20:08 EDT by Glenn Burkhardt CLA
Modified: 2023-03-15 09:44 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Burkhardt CLA 2023-03-12 20:08:08 EDT
I'm using SWT_AWT to run NASA WorldWind in an Eclipse application.  There's a problem when using DPI scaling other than 100%.  The SWT_AWT.new_Frame() method sets the frame size using the current DPI scaling.  The embedded frame is sitting within another SWT composite, and it gets is size when the outer composite layout runs.  The size of the embedded frame shouldn't be changed from what it's given during layout.

In AWT, at least in Java 11, drawing uses the logical coordinates, not the screen coordinates, when DPI scaling is not 100%.  I think that changed in Java 9.

At the very least, it should be possible to disable this feature with a style flag, or similar.  SWT_AWT.new_Frame() calls DPIUtil.autoScaleUp unconditionally on rectangles or points, so the Drawable.isAutoScalable() method can't be used.
Comment 1 Glenn Burkhardt CLA 2023-03-15 09:44:30 EDT
Eclipse Version: 2022-12 (4.26.0)
org.eclipse.swt.win32.win32.x86_64.source_3.122.0.v20221123-2302.jar