Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Linux] read settings from XDG desktop portal if available #33100

Merged
merged 9 commits into from
May 12, 2022

Conversation

jpnurmi
Copy link
Member

@jpnurmi jpnurmi commented May 4, 2022

This PR introduces FlSettingsPortal that implements the FlSettings interface for the XDG desktop portal settings. On older systems where the portal is not available, the current GSettings-based implementation is used. This fixes the issue that Flutter would not detect dark system themes in many desktop environments such as GNOME 42 or later, and KDE.

Replaces: #32456
Fixes: flutter/flutter#101438

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@jpnurmi
Copy link
Member Author

jpnurmi commented May 4, 2022

GNOME 42 (Ubuntu 22.04)

Light Dark
Screenshot from 2022-05-04 14-26-44 Screenshot from 2022-05-04 14-26-27

KDE (Kubuntu 22.04)

Light Dark
Screenshot from 2022-05-04 10-45-37 Screenshot from 2022-05-04 10-45-07

GNOME 3.36.8 (Pop!_OS 20.04)

Light Dark
Screenshot from 2022-05-04 15-52-58 Screenshot from 2022-05-04 15-53-03

@jpnurmi jpnurmi force-pushed the settings-portal branch from 34f9e85 to a4d8546 Compare May 4, 2022 12:12
Copy link
Contributor

@robert-ancell robert-ancell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

@jpnurmi jpnurmi requested a review from robert-ancell May 9, 2022 07:36
Copy link
Contributor

@robert-ancell robert-ancell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpnurmi jpnurmi mentioned this pull request May 10, 2022
8 tasks
@chinmaygarde
Copy link
Member

Can we land this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[linux] system theme changes not followed on gnome 42
3 participants