Skip to content

Commit 485749a

Browse files
HeikoKlareakoch-yatta
authored andcommitted
[Win32] Move relayout call to end of DPI change processing
When processing a DPI change event, a relayout of the shell is currently scheduled when the event reaches the shell. With asynchronous event processing, this can lead to the layouting being performed too early, i.e., when not all contained controls are already updated. With this change, the layout call for the shell is moved to the end of the DPI change process, such that relayouting is only performed when all controls have been updated.
1 parent fd18da9 commit 485749a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5948,7 +5948,7 @@ void sendZoomChangedEvent(Event event, Shell shell) {
59485948
}
59495949
if (dpiExecData.decrement()) {
59505950
if (event.doit) {
5951-
shell.WM_SIZE(0, 0);
5951+
shell.layout(true, true);
59525952
}
59535953
}
59545954
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,9 +2787,4 @@ LRESULT WM_WINDOWPOSCHANGING (long wParam, long lParam) {
27872787
return result;
27882788
}
27892789

2790-
@Override
2791-
void handleDPIChange(Event event, float scalingFactor) {
2792-
super.handleDPIChange(event, scalingFactor);
2793-
layout (null, SWT.DEFER | SWT.ALL | SWT.CHANGED);
2794-
}
27952790
}

0 commit comments

Comments
 (0)