File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ public abstract class Control extends Widget implements Drawable {
8282 Font font ;
8383 int drawCount , foreground , background , backgroundAlpha = 255 ;
8484
85+ private static final String DATA_NATIVE_ZOOM = "NATIVE_ZOOM" ;
86+
8587/**
8688 * Prevents uninitialized instances from being created outside the package.
8789 */
@@ -1258,6 +1260,15 @@ public Cursor getCursor () {
12581260 return cursor ;
12591261}
12601262
1263+ @ Override
1264+ public Object getData (String key ) {
1265+ if (DATA_NATIVE_ZOOM .equals (key )) {
1266+ Shell shell = getShell ();
1267+ return shell == null ? null : shell .nativeZoom ;
1268+ }
1269+ return super .getData (key );
1270+ }
1271+
12611272/**
12621273 * Returns <code>true</code> if the receiver is detecting
12631274 * drag gestures, and <code>false</code> otherwise.
Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ public abstract class Widget {
134134 static final int AUTO_TEXT_DIRECTION = SWT .LEFT_TO_RIGHT | SWT .RIGHT_TO_LEFT ;
135135
136136 private static final String DATA_AUTOSCALE_DISABLED = "AUTOSCALE_DISABLED" ;
137- private static final String DATA_NATIVE_ZOOM = "NATIVE_ZOOM" ;
138137
139138 /* Initialize the Common Controls DLL */
140139 static {
@@ -190,7 +189,6 @@ public Widget (Widget parent, int style) {
190189 display = parent .display ;
191190 reskinWidget ();
192191 notifyCreationTracker ();
193- this .setData (DATA_NATIVE_ZOOM , this .nativeZoom );
194192}
195193
196194void _addListener (int eventType , Listener listener ) {
@@ -2719,7 +2717,6 @@ int getZoom() {
27192717
27202718private static void handleDPIChange (Widget widget , int newZoom , float scalingFactor ) {
27212719 widget .nativeZoom = newZoom ;
2722- widget .setData (DATA_NATIVE_ZOOM , newZoom );
27232720}
27242721
27252722int getSystemMetrics (int nIndex ) {
You can’t perform that action at this time.
0 commit comments