File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ public abstract class Control extends Widget implements Drawable {
8282 /** Cache for currently processed DPI change event to be able to cancel it if a new one is triggered */
8383 Event currentDpiChangeEvent ;
8484
85+ private static final String DATA_SHELL_ZOOM = "SHELL_ZOOM" ;
8586/**
8687 * Prevents uninitialized instances from being created outside the package.
8788 */
@@ -1260,6 +1261,15 @@ public Cursor getCursor () {
12601261 return cursor ;
12611262}
12621263
1264+ @ Override
1265+ public Object getData (String key ) {
1266+ if (DATA_SHELL_ZOOM .equals (key )) {
1267+ Shell shell = getShell ();
1268+ return shell == null ? null : shell .nativeZoom ;
1269+ }
1270+ return super .getData (key );
1271+ }
1272+
12631273/**
12641274 * Returns <code>true</code> if the receiver is detecting
12651275 * 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 {
@@ -189,7 +188,6 @@ public Widget (Widget parent, int style) {
189188 display = parent .display ;
190189 reskinWidget ();
191190 notifyCreationTracker ();
192- this .setData (DATA_NATIVE_ZOOM , this .nativeZoom );
193191 registerDPIChangeListener ();
194192}
195193
@@ -2727,9 +2725,7 @@ int getZoom() {
27272725}
27282726
27292727void handleDPIChange (Event event , float scalingFactor ) {
2730- int newZoom = event .detail ;
2731- this .nativeZoom = newZoom ;
2732- this .setData (DATA_NATIVE_ZOOM , newZoom );
2728+ this .nativeZoom = event .detail ;
27332729}
27342730
27352731int getSystemMetrics (int nIndex ) {
You can’t perform that action at this time.
0 commit comments