Skip to content

Text sometimes partially disappears in Section when using autoscaling #2980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
selundqma opened this issue May 14, 2025 · 5 comments
Open
Labels
bug Something isn't working

Comments

@selundqma
Copy link
Contributor

selundqma commented May 14, 2025

We set the text "Service Properties" in a Section and it is showed nicely when creating an RCP application using Eclipse 2024-12 in all scaling variants. But, in newer versions (2025-03, 2025-06 M1, 2025-06 M2) some of text disappears when using different scaling in Windows. Like, on my laptop it works fine in 125% scaling. Moving over to 150% and some of the text is missing in the Section. By removing the autoscaling from the ini file, the text appears also in the 150% case. So... there might be an issue with how sizes are calculated when using autoscaling.

OS: Windows 11
Java: JDK 21.0.6.7.1
Issue seen from: Eclipse 2025-03

Scaling parameters used in the ini file

-Dswt.autoScale=quarter
-Dswt.autoScale.method=smooth

The section is created with the FormToolkit like this:

final Section vPropSection = pFormToolkit.createSection(
            pFormBody,
            Section.DESCRIPTION
                  | Section.TWISTIE
                  | Section.TITLE_BAR
                  | Section.EXPANDED);
      vPropSection
            .setText(UIMessages.ServiceListUIHelper_ServiceProperties);

See attached images for the different cases (no autoscaling + 125%/150% OS scaling / autoscaling + 125%/150% OS scaling)

Image
Image
Image
Image

We also have issues with disappearing text in the same manner in org.eclipse.swt.widgets.Label where the last word sometimes (according to the scenarios mentioned above) is going missing.

-Dswt.autoScale=exact yields the same result.

@selundqma selundqma added the bug Something isn't working label May 14, 2025
@fedejeanne
Copy link
Contributor

fedejeanne commented May 14, 2025

I can reproduce the error by adding the style-bit Section.TITLE_BAR to the FormView in line 158 and then opening the Eclipse Form view.

Image

For me it happens when using a monitor zoom of 175% in my ThinkVision 34'' (true-split is deactivated).

I assume this is another flavor of eclipse-platform/eclipse.platform.swt#2003 and the layout might be the culprit, but I haven't analyzed this in detail.

Workaround

  • Either remove the style-bit Section.TITLE_BAR or
  • Add yet another style-bit: ExpandableComposite.FOCUS_TITLE

@akoch-yatta / @amartya4256 can you please look into it and see if it's indeed related to eclipse-platform/eclipse.platform.swt#2003 ?

@akoch-yatta
Copy link
Contributor

Looks like a similar issue, yes, but it doesn't look exactly the same. However, still investigating it @fedejeanne

akoch-yatta added a commit to vi-eclipse/eclipse.platform.ui that referenced this issue May 15, 2025
This commit adds one additional point to the width when calculating the
minimum size of the textLabel in ExpandableComposite. This serves as a
workaround for a current limitation in the SWT implementation on Windows.
With certain zoom settings (e.g., 125% or 175%), depending on the length
of the label text, the calculated width may be too small, causing the
text to wrap unnecessarily. This is intended as a temporary workaround.

Contributes to eclipse-platform#2980
akoch-yatta added a commit to vi-eclipse/eclipse.platform.ui that referenced this issue May 15, 2025
This commit adds one additional point to the width when calculating the
minimum size of the textLabel in ExpandableComposite. This serves as a
workaround for a current limitation in the SWT implementation on Windows.
With certain zoom settings (e.g., 125% or 175%), depending on the length
of the label text, the calculated width may be too small, causing the
text to wrap unnecessarily. This is intended as a temporary workaround.

Contributes to eclipse-platform#2980
@selundqma
Copy link
Contributor Author

selundqma commented May 16, 2025

Maybe a stupid question, but will the suggested fix also handle the missing text using org.eclipse.swt.widgets.Label? Or is a separate ticket needed on another GitHub for that case? We use the SWT.WRAP flag for the labels. And.. in the same way as text disappears from Section, it also happens with Label.

@fedejeanne
Copy link
Contributor

I assume "the fix" is #2986? That PR only touches the class ExpandableComposite so no, it shouldn't fix the issue for Label.

Could you provide more details and a reproducer for the issue with the label? I can imagine we would need another Issue/PR for that.

fedejeanne pushed a commit that referenced this issue May 19, 2025
This commit adds one additional point to the width when calculating the
minimum size of the textLabel in ExpandableComposite. This serves as a
workaround for a current limitation in the SWT implementation on Windows.
With certain zoom settings (e.g., 125% or 175%), depending on the length
of the label text, the calculated width may be too small, causing the
text to wrap unnecessarily. This is intended as a temporary workaround.

Contributes to #2980
@selundqma
Copy link
Contributor Author

New issue created for the SWT Label case. Attached a Reproducer in that ticket.

eclipse-platform/eclipse.platform.swt#2166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants