Skip to content

Commit 0dcefc9

Browse files
committed
Modify handleMonitorSpecificDpiChange to call setBounds before sending
zoomChangedEvent This change ensures that setBounds is applied before the zoomChangedEvent is dispatched. By doing so, event listeners of ZoomChanged can modify the shell size additionally if required. For example, this is useful in eclipse-platform/eclipse.platform.ui#3212 , where the shell size needs to be set by the ZoomChanged listener.
1 parent 93a484e commit 0dcefc9

File tree

1 file changed

+2
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

1 file changed

+2
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4959,8 +4959,9 @@ LRESULT WM_DESTROY (long wParam, long lParam) {
49594959
void handleMonitorSpecificDpiChange(int newNativeZoom, Rectangle newBoundsInPixels) {
49604960
float scalingFactor = 1f * DPIUtil.getZoomForAutoscaleProperty(newNativeZoom) / DPIUtil.getZoomForAutoscaleProperty(nativeZoom);
49614961
DPIUtil.setDeviceZoom (newNativeZoom);
4962-
DPIZoomChangeRegistry.applyChange(this, newNativeZoom, scalingFactor);
49634962
this.setBoundsInPixels(newBoundsInPixels.x, newBoundsInPixels.y, newBoundsInPixels.width, newBoundsInPixels.height);
4963+
DPIZoomChangeRegistry.applyChange(this, newNativeZoom, scalingFactor);
4964+
49644965
}
49654966

49664967
LRESULT WM_DPICHANGED (long wParam, long lParam) {

0 commit comments

Comments
 (0)