Skip to content

fix(dfm,theme): silence GTK markup + Adwaita dark-theme warnings#96

Merged
VictorGSchneider merged 2 commits into
mainfrom
claude/dfm-markup-and-theme-fixes
May 16, 2026
Merged

fix(dfm,theme): silence GTK markup + Adwaita dark-theme warnings#96
VictorGSchneider merged 2 commits into
mainfrom
claude/dfm-markup-and-theme-fixes

Conversation

@VictorGSchneider
Copy link
Copy Markdown
Owner

@VictorGSchneider VictorGSchneider commented May 16, 2026

Follow-up to #95. Two more warnings observed when launching dfm:

Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.
Gtk-WARNING: Failed to set text 'Notes & Tags' from markup due to error parsing markup: Entity did not end with a semicolon...
Gtk-WARNING: Failed to set text 'Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)' from markup due to error parsing markup...

Commits

fix(dfm): escape Pango markup in row titles from config comments

Adw.PreferencesRow titles and subtitles are parsed as Pango markup, so config keys/comments containing & or < (e.g. the oh-my-zsh .zshrc 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 them to Adw.SwitchRow / Adw.ActionRow in window_config_page_fields.py. Single escape point in create_field_row covers every field type (toggle, slider, color, number, path, keybind, font, text).
  • Fix the literal 'Notes & Tags' group title to 'Notes &amp; Tags' in window_config_page_sections.py.

fix(theme): drop deprecated prefer-dark-theme from gtk-4.0 settings

libadwaita ignores gtk-application-prefer-dark-theme and prints Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported on every GTK4 app launch.

Dark mode for GTK4 / libadwaita is already driven by the gsettings key org.gnome.desktop.interface color-scheme = 'prefer-dark', which theme/pacman-hooks/stoa-theme-enforce sets (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_compile on the touched DFM modules.
  • Inspected the diff against current main (post-fix(dfm): handle non-directory entries in ~/.config scan #95 merge).
  • Manual: launch dfm after git pull — the three warnings above should be gone. (Run sudo /usr/local/bin/stoa-theme-enforce once if gsettings get org.gnome.desktop.interface color-scheme doesn't already return 'prefer-dark'.)

Generated by Claude Code

claude added 2 commits May 16, 2026 00:51
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 &amp; 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.
@VictorGSchneider VictorGSchneider merged commit ff34b96 into main May 16, 2026
1 check passed
@VictorGSchneider VictorGSchneider deleted the claude/dfm-markup-and-theme-fixes branch May 16, 2026 00:53
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