Skip to content

Commit ab6265f

Browse files
committed
Add N&N for SWT API enhancement to enable monitor-specific UI rescaling
eclipse-platform/eclipse.platform.swt#1358
1 parent 415b202 commit ab6265f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

news/4.34/platform_isv.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,35 @@ <h2>Platform and Equinox API</h2>
4444
<tr>
4545
<td id="SWT" class="section" colspan="2"><h2>SWT Changes</h2></td>
4646
</tr>
47+
<tr id="display_rescaling_windows"> <!-- https://github.com/eclipse-platform/eclipse.platform.swt/pull/1358 -->
48+
<td class="title">Monitor-Specific UI Rescaling in Display Class (Windows only)</td>
49+
<td class="content">
50+
<p>
51+
The API methods
52+
<code>org.eclipse.swt.widgets.Display#setRescalingAtRuntime(boolean)</code> and
53+
<code>org.eclipse.swt.widgets.Display#isRescalingAtRuntime()</code> have been added to SWT.
54+
These methods allow to enable, disable, and retrieve the state of the "rescaling at runtime" functionality.
55+
When enabled, it makes shells and their contents sharply rescale according to the current monitor they are placed on
56+
or moved to.
57+
<p>
58+
<p>
59+
Note that in order to work as expected, enabling the rescaling at runtime functionality will also set the DPI
60+
awareness of the Display's thread to <a
61+
href="https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process">PerMonitorV2</a>.
62+
This happens even if the DPI awareness of the Java process itself is set to some different value.
63+
</p>
64+
<p>
65+
To ensure backwards compatibility, this feature is disabled by default. The feature has to be enabled for a
66+
<code>Display</code> it is supposed to be used for. It needs to be activated before a shell is created to take
67+
proper effect.
68+
As an example, the feature can be enabled in Eclipse applications via a preference, see <a
69+
href="platform.php#rescale-on-runtime-preference">this news</a>.
70+
</p>
71+
<p>
72+
<b>Note:</b> Those methods will currently only have an effect on Windows.
73+
</p>
74+
</td>
75+
</tr>
4776
<!-- *********************** End of SWT *********************** -->
4877
<tr><td colspan="2"/></tr>
4978
</tbody>

0 commit comments

Comments
 (0)