Skip to content

Inconsistent dimension handling for Browser #2974

@fipro78

Description

@fipro78

Describe the bug
While trying to add support for monitor specific scaling to the RichTextEditor control in Nebula, I noticed some issues related to scaling. This is especially related to resizing of the RichTextEditor in embedded mode. This means the editor is used as cell editor in a table for example.

There are resize listeners to ensure that the Shell in which the RichTextEditor is placed when opened in embedded mode has the necessary dimensions. This works well when using the Internet Explorer as browser and autoscaling is disabled. It gets totally crazy when enabling autoscaling and even worse when using Edge. In those cases the dimensions of the Shell are changed unexpectedly, the width is suddenly decreasing until 0 and the height is increasing until the application crashes.

To Reproduce
The easiest way is to checkout the Nebula repository and start the JFaceViewerIntegrationExample

  • In the opened table click on a cell in the Description column. This opens the RichTextEditor in embedded mode.
  • Expand the toolbar via the small button in the upper right corner
  • Watch the editor dimensions going crazy

I tested it on a monitor with 150% zoom. Maybe it is related to the zoom level. But I played around with the swt.autoScale.updateOnRuntime property, so not sure.

I tried out the following combinations:

-Dswt.autoScale.updateOnRuntime=false -Dorg.eclipse.swt.browser.DefaultType=ie

The behavior is mostly as expected. Only the second time I open an editor and expand the toolbar, the location of the Shell moves to 0/0. But I am not sure if this is an issue in the implementation. Although I haven't seen this in the past.

-Dswt.autoScale.updateOnRuntime=true -Dorg.eclipse.swt.browser.DefaultType=ie

The Shell slowly increases by 1 pixel in width and height. Seems to be some rounding issue.

-Dswt.autoScale.updateOnRuntime=false -Dorg.eclipse.swt.browser.DefaultType=edge

The Shell width shrinks until 0, the height increases infinitely, the application crashes at the end.

-Dswt.autoScale.updateOnRuntime=true -Dorg.eclipse.swt.browser.DefaultType=edge

The Shell width shrinks until 0, the height increases infinitely, the application crashes at the end.

So I guess there are some rounding issues and maybe the width and height is swapped somewhere in the Edge implementation.

Expected behavior
When expanding or collapsing the toolbar, the size of the embedded Shell of the RichTextEditor updates once and stays in the correct dimensions. Like with setting -Dswt.autoScale.updateOnRuntime=false -Dorg.eclipse.swt.browser.DefaultType=ie

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)

  2. JRE/JDK version

Java 17

Version since
Noticed it with Eclipse 2025-12 which is SWT 3.132.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions