Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: Get the color scheme through xdg-desktop-portal #11926

Merged
merged 12 commits into from
May 27, 2024

Conversation

citorva
Copy link
Contributor

@citorva citorva commented May 16, 2024

The method has been tested on:

  • Gnome 46 (Working)
  • Gnome 40 (Not supported)

Tasks

  • Implements a draft which get and provides the user theme to components which needs it
  • Implements a way to call the callback function when the theme is updated
  • Cleans the code

Release notes:

  • N/A

Copy link

cla-bot bot commented May 16, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: citorva.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@mikayla-maki mikayla-maki self-assigned this May 16, 2024
@citorva citorva marked this pull request as ready for review May 16, 2024 20:43
@citorva citorva marked this pull request as draft May 16, 2024 20:43
@citorva
Copy link
Contributor Author

citorva commented May 16, 2024

I have fixed my email configuration @cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 16, 2024
Copy link

cla-bot bot commented May 16, 2024

The cla-bot has been summoned, and re-checked this pull request!

@citorva
Copy link
Contributor Author

citorva commented May 22, 2024

Theme update is now supported by the application:
example-auto-theme

@citorva citorva changed the title Get the color scheme through xdg-desktop-portal linux: Get the color scheme through xdg-desktop-portal May 22, 2024
@citorva
Copy link
Contributor Author

citorva commented May 26, 2024

Supporting Gnome < 42 requires the use of alternate way such as listening the gtk theme through GSettings

@citorva citorva marked this pull request as ready for review May 26, 2024 14:12
@zed-industries-bot

This comment was marked as off-topic.

@mikayla-maki
Copy link
Contributor

This looks great! I'm a bit nervous about the blocking call on startup to get the right variables, as we don't want to delay initialization time anymore than absolutely necessary. That said, it might be fine! So let's try it and see how it feels :)

@mikayla-maki mikayla-maki merged commit a84344a into zed-industries:main May 27, 2024
11 checks passed
@citorva
Copy link
Contributor Author

citorva commented May 27, 2024

This looks great! I'm a bit nervous about the blocking call on startup to get the right variables, as we don't want to delay initialization time anymore than absolutely necessary. That said, it might be fine! So let's try it and see how it feels :)

I have worked without the blocking initialization at the beginning, however, when using calloop, the theme given at the initialization was not the system's theme but the default value in the code. I think that the issue is due to the fact that the first event occurs before the end of the UI initialization and is drop. As I didn't want to change the behavior of this feature, I have used the blocking method to get the initial color scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants