Skip to content

Conversation

@City-busz
Copy link

This ensures that the icon theme and button layout for GNOME applications are not overwritten at login or when changed in the settings if the apply_theme_global setting is disabled. This allows users to decide whether they want COSMIC to modify GNOME settings.

@jacobgkau jacobgkau requested review from a team November 4, 2025 19:29
Copy link
Member

@mmstick mmstick left a comment

Choose a reason for hiding this comment

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

These shouldn't be gated by the global theme setting. This is needed globally or else window controls and icons won't match. In fact, on a first login, if the icon theme is not set to match the desktop, there will be missing icons in a lot of applications. You'll also see that GTK apps will be missing minimize and maximize buttons even though its the default for COSMIC.

@City-busz
Copy link
Author

City-busz commented Nov 4, 2025

For the default settings, it's possible to set session-dependent defaults just for the COSMIC session by creating a GSettings override file, e.g. /usr/share/glib-2.0/schemas/30_com.system76.Cosmic.gschema.override with the following content:

[org.gnome.desktop.interface:COSMIC]
icon-theme='Cosmic'

[org.gnome.desktop.wm.preferences:COSMIC]
button-layout=':minimize,maximize,close'

In this way, the default settings will match with COSMIC, but still allows the user to set a custom button layout and icon theme for GTK apps.

@City-busz
Copy link
Author

I updated this pull request to include a GSettings override file to match the default settings with COSMIC, so there will be no difference on first login.

@City-busz City-busz requested a review from mmstick November 4, 2025 20:31
@mmstick
Copy link
Member

mmstick commented Nov 4, 2025

The button layout for window controls and icons should still be kept in sync with modifications made in COSMIC Settings. If you disable the minimize or maximize buttons in COSMIC Settings, that should also be applied to GTK applications. Same for icon themes. The global theme variable is specifically about overriding the GTK4/libadwaita CSS file.

@City-busz
Copy link
Author

Why does the global theme variable apply only for setting color-scheme and gtk-theme? The Settings dialog says "Apply this theme to GNOME apps". I would expect that if it's disabled, then no theme settings will be applied for GNOME apps, including the button-layout and icon-theme settings.

Without this, it's impossible to set custom button layout for GTK apps, because it always gets overridden on login.

@City-busz
Copy link
Author

Also, the font-name is set only on change by cosmic-settings, and the monospace-font is not saved into GSettings.

Maybe it would better to implement these properties within the Settings portal in xdg-desktop-portal-cosmic. GTK no longer reads GSettings, and relies only on portal: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8923

This ensures that the icon theme and button layout for GNOME applications
are not overwritten at login and when changed in the settings if the
'apply_theme_global' setting is disabled. This allows users to decide
whether they want COSMIC to modify GNOME settings.
@City-busz
Copy link
Author

I opened another pull request: #117

  1. This one sets the button layout and icon theme only if apply_theme_global is enabled.
  2. That one sets the button layout only if changed, and relies on GSettings override for the initial settings.

Both solutions would be fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants