fix(dfm,theme): silence GTK markup + Adwaita dark-theme warnings#96
Merged
Conversation
Adw.PreferencesRow titles and subtitles are parsed as Pango markup, so config keys/comments containing '&' or '<' (e.g. zsh comment 'Caution: ... in zsh < 5.7.1') triggered repeated 'Failed to set text from markup' Gtk warnings on every row redraw. - Run field.key and field.comment through GLib.markup_escape_text before passing to Adw.SwitchRow / Adw.ActionRow in window_config_page_fields.py - Fix the literal 'Notes & Tags' group title to 'Notes & Tags' in window_config_page_sections.py
libadwaita ignores gtk-application-prefer-dark-theme and prints 'Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.' on every GTK4 app launch (dfm, etc). Dark mode for GTK4 / libadwaita is already driven by the gsettings key org.gnome.desktop.interface color-scheme = 'prefer-dark', which the stoa-theme-enforce pacman hook sets. So removing the deprecated line is a no-op for visual behaviour and silences the warning. Kept in theme/gtk-3.0/settings.ini — the key is still valid for GTK3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #95. Two more warnings observed when launching
dfm:Commits
fix(dfm): escape Pango markup in row titles from config commentsAdw.PreferencesRowtitles and subtitles are parsed as Pango markup, so config keys/comments containing&or<(e.g. the oh-my-zsh.zshrccomment "Caution: ... in zsh < 5.7.1") triggered repeatedFailed to set text from markupGtk warnings on every row redraw.field.keyandfield.commentthroughGLib.markup_escape_textbefore passing them toAdw.SwitchRow/Adw.ActionRowinwindow_config_page_fields.py. Single escape point increate_field_rowcovers every field type (toggle, slider, color, number, path, keybind, font, text).'Notes & Tags'group title to'Notes & Tags'inwindow_config_page_sections.py.fix(theme): drop deprecated prefer-dark-theme from gtk-4.0 settingslibadwaita ignores
gtk-application-prefer-dark-themeand printsAdwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupportedon every GTK4 app launch.Dark mode for GTK4 / libadwaita is already driven by the gsettings key
org.gnome.desktop.interface color-scheme = 'prefer-dark', whichtheme/pacman-hooks/stoa-theme-enforcesets (line 44). So removing the deprecated line is a no-op for visual behaviour and silences the warning.Kept in
theme/gtk-3.0/settings.ini— the key is still valid for GTK3.Test plan
python3 -m py_compileon the touched DFM modules.main(post-fix(dfm): handle non-directory entries in ~/.config scan #95 merge).dfmaftergit pull— the three warnings above should be gone. (Runsudo /usr/local/bin/stoa-theme-enforceonce ifgsettings get org.gnome.desktop.interface color-schemedoesn't already return'prefer-dark'.)Generated by Claude Code