-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
The nativeZoom
of widgets currently always has the original native zoom value, even if autoscaling is disabled for that widget such that they behave as if their native zoom is effectively 100. As a consequence, some consumers such as DropTarget#convertPixelToPoint
erroneously use the original native zoom instead of 100 in case autoscaling is disabled for that widget. This particular consumer leads to an offset of the mouse position when dropping elements into such a control.
Reproduction
The drop scenario sketched above can be easily reproduced with Snippet257
:
- Adapt the snippet as follows:
- Start it with monitor-specific scaling enabled, e.g., add the following for line to the
main
method:System.setProperty("swt.autoScale.updateOnRuntime", "true");
- Disabled autoscaling for StyledText control, i.e., call
text.setData("AUTOSCALE_DISABLED", "true");
after instantiatingtext
- Start it with monitor-specific scaling enabled, e.g., add the following for line to the
- Start the snippet and move the shell to a monitor with zoom != 100% (it's also sufficient if it starts on primary monitor with zoom != 100)
- Drag a text from somewhere es and try to drop it into the text widget.
Here is how it looks on 200% monitor because of the wrong coordinate conversion:
Expected Behavior
Widget#nativeZoom
shall be adapted to always contain the actual native zoom, i.e., 100 in case autoscaleDisabled==true
. All accesses to Widget#nativeZoom
shall be summarized in this issue (or in the according PR) and evaluated regarding whether it is correct to use 100 when autoscaling is disabled or not. In cases where it may not be correct, getData(DATA_NATIVE_ZOOM)
could be used to access the original native zoom.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status