Skip to content

WizardDialog resizes itself in an endless loop after a DPI change ecl… - #4428

Open
astrograph wants to merge 1 commit into
eclipse-platform:masterfrom
astrograph:wizarddialog-resize-loop
Open

astrograph wants to merge 1 commit into
eclipse-platform:masterfrom
astrograph:wizarddialog-resize-loop

Conversation

@astrograph

@astrograph astrograph commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   44m 6s ⏱️ - 16m 33s
 8 474 tests +3   8 233 ✅ +2  240 💤 ±0  1 ❌ +1 
21 294 runs  +9  20 616 ✅ +8  677 💤 ±0  1 ❌ +1 

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.

@astrograph
astrograph force-pushed the wizarddialog-resize-loop branch from b3b863c to 5007d43 Compare October 8, 2026 06:40
@iloveeclipse

Copy link
Copy Markdown
Member

@astrograph : we do not allow merge commits. Please update to latest master, cherry-pick your single commit with the fix and force push.

@astrograph astrograph closed this Oct 8, 2026
@astrograph
astrograph force-pushed the wizarddialog-resize-loop branch from 77c5495 to 883523e Compare October 8, 2026 11:32
@astrograph astrograph reopened this Oct 8, 2026
@astrograph
astrograph force-pushed the wizarddialog-resize-loop branch from ddb37eb to 357c597 Compare October 8, 2026 14:35
@eclipse-eca-validation

Copy link
Copy Markdown

Hi @astrograph — thank you for your contribution!

The Eclipse Contributor Agreement (ECA) check has failed for this pull request for the following reason(s):

  • An Eclipse Contributor Agreement is required for Eclipse user 'mmisingnameg5t'(committer).

To resolve this, please:

  1. Sign in or create an Eclipse Foundation account on the Eclipse Foundation Accounts site
  2. Ensure your GitHub username is linked to your Eclipse account under the "Link GitHub Account" tab in the Edit Profile section
  3. Complete and submit the ECA form

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!

@astrograph
astrograph force-pushed the wizarddialog-resize-loop branch from 357c597 to dab36ae Compare October 13, 2026 07:07
@astrograph

Copy link
Copy Markdown
Contributor Author

"Rebased onto master as a single commit, ECA and all checks pass now.

@astrograph

Copy link
Copy Markdown
Contributor Author

@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?

@iloveeclipse

Copy link
Copy Markdown
Member

@HeikoKlare : I'm not able to test it, as I never change DPI on Linux. Can you please check this?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.RESIZE flag.
  • 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)) {
Comment on lines +351 to +352
protected boolean isResizable() {
return (getShellStyle() & SWT.RESIZE) != 0;
@astrograph
astrograph force-pushed the wizarddialog-resize-loop branch 3 times, most recently from 257b820 to fafac52 Compare October 22, 2026 10:58
…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>
@astrograph
astrograph force-pushed the wizarddialog-resize-loop branch from fafac52 to 0bdba00 Compare October 22, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WizardDialog resizes itself in an endless loop after a DPI change

3 participants