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 {
82
82
/** Cache for currently processed DPI change event to be able to cancel it if a new one is triggered */
83
83
Event currentDpiChangeEvent ;
84
84
85
+ private static final String DATA_SHELL_ZOOM = "SHELL_ZOOM" ;
85
86
/**
86
87
* Prevents uninitialized instances from being created outside the package.
87
88
*/
@@ -1260,6 +1261,15 @@ public Cursor getCursor () {
1260
1261
return cursor ;
1261
1262
}
1262
1263
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
+
1263
1273
/**
1264
1274
* Returns <code>true</code> if the receiver is detecting
1265
1275
* 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 {
134
134
static final int AUTO_TEXT_DIRECTION = SWT .LEFT_TO_RIGHT | SWT .RIGHT_TO_LEFT ;
135
135
136
136
private static final String DATA_AUTOSCALE_DISABLED = "AUTOSCALE_DISABLED" ;
137
- private static final String DATA_NATIVE_ZOOM = "NATIVE_ZOOM" ;
138
137
139
138
/* Initialize the Common Controls DLL */
140
139
static {
@@ -189,7 +188,6 @@ public Widget (Widget parent, int style) {
189
188
display = parent .display ;
190
189
reskinWidget ();
191
190
notifyCreationTracker ();
192
- this .setData (DATA_NATIVE_ZOOM , this .nativeZoom );
193
191
registerDPIChangeListener ();
194
192
}
195
193
@@ -2727,9 +2725,7 @@ int getZoom() {
2727
2725
}
2728
2726
2729
2727
void 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 ;
2733
2729
}
2734
2730
2735
2731
int getSystemMetrics (int nIndex ) {
You can’t perform that action at this time.
0 commit comments