Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

This PR adds two additional points to the width and height when calculating the size of the composite containing the Hyperlinks in the MultipleHyperlinkPresenter. This serves as a workaround for a current limitation in the SWT implementation on Windows. With certain zoom settings (e.g., 125%, 175% or 225%), the calculated size may be too small, causing the Composite to show Scrollbars, although it calculated to not need scrollbars. This additional width/height is only added for windows and when no scrollbars should be thrown. This is intended as a temporary workaround.

This is intended as a temporary workaround. If we merge this, we should either revert it after the release to reintroduce the issue or have hopefully a proper fix inside of SWT. Still, as it affects a quite central element, I would propose to merge this PR.

How to test

Use this Snippet and open it on a 225% monitor.

package test;

public class TestClass {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
	}
}

Without the PR you will see:
image

@HeikoKlare HeikoKlare force-pushed the workaround-MultipleHyperlinkPresenter branch from f450811 to 947e466 Compare May 20, 2025 13:26
@github-actions
Copy link
Contributor

github-actions bot commented May 20, 2025

Test Results

 1 824 files  ±0   1 824 suites  ±0   1h 35m 45s ⏱️ - 3m 31s
 7 925 tests ±0   7 697 ✅ ±0  228 💤 ±0  0 ❌ ±0 
23 862 runs  ±0  23 114 ✅ ±0  748 💤 ±0  0 ❌ ±0 

Results for commit 42d9884. ± Comparison against base commit c741652.

♻️ This comment has been updated with latest results.

@akoch-yatta akoch-yatta force-pushed the workaround-MultipleHyperlinkPresenter branch 3 times, most recently from a47014f to c30c366 Compare May 20, 2025 15:51
This commit adds two additional points to the width and height
when calculating the size of the composite containing the Hyperlinks in
the MultipleHyperlinkPresenter. Additionally this refreshes the size of
the parent shell to prevent additional scrollbars in some zoom levels.
This serves as a workaround for a current limitation in the SWT
implementation on Windows. With certain zoom settings (e.g., 125%, 175%
or 225%), the calculated size may be too small, causing the Composite to
show Scrollbars, although it calculated to not need scrollbars. This
additional width/height is only added for windows and when no
scrollbars should be thrown.
@HeikoKlare HeikoKlare force-pushed the workaround-MultipleHyperlinkPresenter branch from c30c366 to 42d9884 Compare May 20, 2025 16:07
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

I've tested the workaround in a current SDK. It properly solves the mentioned scrollbar issue at all zooms that I was able to test (100, 125, 150, 175, 200, 225).

Since having those scrollbars would be annoying and significantly impact usability, this should go into RC1. I considers this safe to do because:

  • The popup shell is self-contained, so the compensation values for autoscale rounding issues will not affect any enclosing widgets, layouts or the like. It will just slighly increase the shell size. And they are only applied when running on Windows, on which the changes have been tested.
  • The zoom change listener will just reset the shell size. The shell is not manually resizable, so nothing can be overwritten here. It only happens on zoom change, thus if switching back to non-monitor-specific scaling, it would not even be executed.

@HeikoKlare HeikoKlare added this to the 4.36 RC1 milestone May 20, 2025
@HeikoKlare HeikoKlare merged commit a9ec6c9 into eclipse-platform:master May 20, 2025
18 checks passed
@HeikoKlare HeikoKlare deleted the workaround-MultipleHyperlinkPresenter branch May 20, 2025 19:38
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.

2 participants