Repository navigation
WizardDialog resizes itself in an endless loop after a DPI change ecl… - #4428
astrograph wants to merge 1 commit into
Conversation
Test Results 867 files ±0 867 suites ±0 44m 6s ⏱️ - 16m 33s For more details on these failures, see this check. Results for commit 0bdba00. ± Comparison against base commit 99d1b5a. ♻️ This comment has been updated with latest results. |
b3b863c to
5007d43
Compare
|
@astrograph : we do not allow merge commits. Please update to latest master, cherry-pick your single commit with the fix and force push. |
77c5495 to
883523e
Compare
ddb37eb to
357c597
Compare
|
Hi @astrograph — thank you for your contribution! The Eclipse Contributor Agreement (ECA) check has failed for this pull request for the following reason(s):
To resolve this, please:
Once done, push a new commit (or rebase) to re-trigger the ECA validation. If you believe you've already completed these steps, please double-check your account settings or report an issue to the Eclipse Foundation Helpdesk. Thanks again for your contribution! |
357c597 to
dab36ae
Compare
|
"Rebased onto master as a single commit, ECA and all checks pass now. |
|
@iloveeclipse the branch is rebased onto master as a single commit, ECA and all checks are green. Could you have a look when you find the time? |
|
@HeikoKlare : I'm not able to test it, as I never change DPI on Linux. Can you please check this? |
There was a problem hiding this comment.
🟡 Changes recommended
Regression tests are needed for resize-guard behavior and style-dependent wizard resizing.
2 open issues
What changed in this PR
Addresses JFace dialog resize loops after DPI changes, as reported in issue #2986.
Changes:
- Makes wizard resizability reflect the shell’s
SWT.RESIZEflag. - Guards default-size adaptation against nested calls and redundant resizing.
| File | Description |
|---|---|
| bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java | Reports resizability from shell style. |
| bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/Dialog.java | Prevents recursive and unchanged-size updates. |
Review effort: Balanced
| Listener adaptDefaultSizeListener = event -> { | ||
| Shell shell = getShell(); | ||
| if (shell == null || shell.isDisposed()) { | ||
| if (shell == null || shell.isDisposed() || !adaptingDefaultSize.compareAndSet(false, true)) { |
| protected boolean isResizable() { | ||
| return (getShellStyle() & SWT.RESIZE) != 0; |
257b820 to
fafac52
Compare
…ipse-platform/eclipse.platform#2986 WizardDialog builds its shell with SWT.RESIZE but inherits isResizable() == false from Dialog, so hookZoomChangeListenerForDefaultSizedDialogs() installs adaptDefaultSizeListener on every wizard. That listener calls shell.setSize(shell.computeSize(...)), which sends the next SWT.Resize, and it has no re-entrancy guard: whenever the computed size is not a fixed point the listener recurses until the stack is exhausted. Let WizardDialog report the SWT.RESIZE bit of its shell style, and make the listener skip a nested call and a size that has not changed. Fixes eclipse-platform/eclipse.platform#2986 Signed-off-by: Philipp SALZGEBER <Philipp.SALZGEBER@bachmann.info>
fafac52 to
0bdba00
Compare

WizardDialog builds its shell with SWT.RESIZE but inherits isResizable() == false from Dialog, so hookZoomChangeListenerForDefaultSizedDialogs() installs adaptDefaultSizeListener on every wizard. That listener calls shell.setSize(shell.computeSize(...)), which sends the next SWT.Resize, and it has no re-entrancy guard: whenever the computed size is not a fixed point the listener recurses until the stack is exhausted.
Let WizardDialog report the SWT.RESIZE bit of its shell style, and make the listener skip a nested call and a size that has not changed.
Fixes eclipse-platform/eclipse.platform#2986