Skip to main content

Platform and Equinox API

Platform Changes

SWT Changes

Monitor-Specific UI Rescaling in Display Class (Windows only)

The API methods org.eclipse.swt.widgets.Display#setRescalingAtRuntime(boolean) and org.eclipse.swt.widgets.Display#isRescalingAtRuntime() have been added to SWT. These methods allow to enable, disable, and retrieve the state of the "rescaling at runtime" functionality. When enabled, it makes shells and their contents sharply rescale according to the current monitor they are placed on or moved to.

Note that in order to work as expected, enabling the rescaling at runtime functionality will also set the DPI awareness of the Display's thread to PerMonitorV2. This happens even if the DPI awareness of the Java process itself is set to some different value.

To ensure backwards compatibility, this feature is disabled by default. The feature has to be enabled for a Display it is supposed to be used for. It needs to be activated before a shell is created to take proper effect. As an example, the feature can be enabled in Eclipse applications via a preference, see this news.

Note: Those methods will currently only have an effect on Windows.

Previous Up Next

Back to the top