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

Userland: Port some applications to the GML compiler #25637

Closed

Conversation

RatcheT2497
Copy link
Contributor

This PR contributes towards #20518
The ported applications are: ThemeEditor, DisplaySettings and ClockSettings.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Jan 10, 2025
@RatcheT2497 RatcheT2497 force-pushed the various-gml-compilation-ports branch 2 times, most recently from 06eb4fe to 1b593da Compare January 10, 2025 21:56
@RatcheT2497 RatcheT2497 force-pushed the various-gml-compilation-ports branch from 1b593da to 0e87322 Compare January 11, 2025 14:59
@@ -174,11 +164,11 @@ void ThemesSettingsWidget::apply_settings()
auto color_scheme_path = color_scheme_path_or_error.release_value();

if (!m_color_scheme_is_file_based && find_descendant_of_type_named<GUI::CheckBox>("custom_color_scheme_checkbox")->is_checked()) {
auto set_theme_result = GUI::ConnectionToWindowServer::the().set_system_theme(m_selected_theme->path, m_selected_theme->name, m_background_settings_changed, "Custom"sv);
Copy link
Member

Choose a reason for hiding this comment

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

Why is m_background_settings_changed hardcoded to false now?

Copy link
Contributor Author

@RatcheT2497 RatcheT2497 Jan 12, 2025

Choose a reason for hiding this comment

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

I hardcoded it because it was always set to false at the very start of the method unconditionally, which (at least as far as I know) rendered it pretty much moot. It was a reference that BackgroundSettingsWidget set at various points and there currently doesn't seem to be a standardized way of passing variables to compiled widgets either, but it wouldn't make much of a difference.

EDIT: For what it's worth, I tested it a little after removing the forced reset and it didn't seem to do much of anything, so I'm not really sure what's it meant to do...

Copy link
Member

Choose a reason for hiding this comment

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

Removing it seems fine compared to the current state of the code, but could you factor that change out into a separate commit ahead of time? If something breaks then whoever is trying to track down the bug will have an easy time determining whether it was caused by this change or by the GML conversion.

Copy link
Member

Choose a reason for hiding this comment

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

cc @implicitfield, since the line forcing the flag to false was added in #17893 (and it looks like it can't be anything but accidental).

Copy link
Contributor

@implicitfield implicitfield Feb 2, 2025

Choose a reason for hiding this comment

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

I think that was just a rebase mishap; some of those changes there had been sitting around locally for quite some time before they were actually PR'd. m_background_settings_changed was originally set to false at the end of apply_settings, but apparently I ended up moving it to the top of that function instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it still be fine to factor out the change into a separate commit and properly fix it later once there's GMLCompiler infrastructure for it?

Copy link
Member

Choose a reason for hiding this comment

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

That is presumably fine, yes. It's currently broken anyway (and has been since March of 2023), so there should be no issue in delaying the investigation and proper fix until later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a slight problem - I don't think I can make the split commit atomic. The boolean that I'm removing weaves together the BackgroundSettingsWidget and ThemesSettingsWidget, right in the main file, causing a compilation error unless removed or fixed via adding some infrastructure to the GML compiler :/

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it work just fine if you remove the boolean everywhere in the very first commit?

@timschumi timschumi self-requested a review January 22, 2025 05:41
@@ -174,11 +164,11 @@ void ThemesSettingsWidget::apply_settings()
auto color_scheme_path = color_scheme_path_or_error.release_value();

if (!m_color_scheme_is_file_based && find_descendant_of_type_named<GUI::CheckBox>("custom_color_scheme_checkbox")->is_checked()) {
auto set_theme_result = GUI::ConnectionToWindowServer::the().set_system_theme(m_selected_theme->path, m_selected_theme->name, m_background_settings_changed, "Custom"sv);
Copy link
Member

Choose a reason for hiding this comment

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

Removing it seems fine compared to the current state of the code, but could you factor that change out into a separate commit ahead of time? If something breaks then whoever is trying to track down the bug will have an easy time determining whether it was caused by this change or by the GML conversion.

@@ -174,11 +164,11 @@ void ThemesSettingsWidget::apply_settings()
auto color_scheme_path = color_scheme_path_or_error.release_value();

if (!m_color_scheme_is_file_based && find_descendant_of_type_named<GUI::CheckBox>("custom_color_scheme_checkbox")->is_checked()) {
auto set_theme_result = GUI::ConnectionToWindowServer::the().set_system_theme(m_selected_theme->path, m_selected_theme->name, m_background_settings_changed, "Custom"sv);
Copy link
Member

Choose a reason for hiding this comment

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

cc @implicitfield, since the line forcing the flag to false was added in #17893 (and it looks like it can't be anything but accidental).

Copy link

stale bot commented Mar 2, 2025

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

@stale stale bot added the stale label Mar 2, 2025
Copy link

stale bot commented Mar 10, 2025

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

@stale stale bot closed this Mar 10, 2025
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants