RFR: 8343398: Add reducedData preference [v6]

Kevin Rushforth kcr at openjdk.org
Wed Dec 18 19:33:42 UTC 2024


On Thu, 12 Dec 2024 01:03:26 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> The `reducedData` preference instructs applications to minimize internet traffic, as users might be on a metered network or a limited data plan.
>> 
>> This corresponds to the following OS settings:
>> 
>> Windows: Settings -> Network and Internet -> Ethernet/WiFi -> Metered connection
>> macOS: Settings -> Network -> Ethernet/WiFi -> Network Settings -> Low data mode
>> Ubuntu: Settings -> Network -> Wired/WiFi -> Metered connection
>> 
>> Change notifications work consistently on Windows and macOS. On my Ubuntu 24 system, the GIO `network-changed` signal is not sent when I only toggle the "metered connection" flag in network settings (and there's no signal specifically for low-data mode). The new value is only picked up when the connection changes by coming offline or going online.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
> 
>   formatting

The changes to GlassApplication where you assume that `[NSApp delegate]` is a `GlassApplication` won't work in the case where the AWT toolkit is initialized first (e.g., a JFXPanel app).

modules/javafx.graphics/src/main/native-glass/mac/GlassApplication.m line 1271:

> 1269: {
> 1270:     GlassApplication* app = (GlassApplication*)[NSApp delegate];
> 1271:     return [app getPlatformPreferences];

I think this is the cause of the crash. You cannot assume that `[NSApp delegate]` is a `GlassApplication`. In the case where AWT initializes the toolkit first, it won't be.

-------------

Changes requested by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1656#pullrequestreview-2512700869
PR Review Comment: https://git.openjdk.org/jfx/pull/1656#discussion_r1890737991


More information about the openjfx-dev mailing list