From 370ef4ba3ccf88bec959a647249f8f720204cc17 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Mon, 16 Mar 2026 14:58:57 -0400 Subject: profile-editor: fix color scheme combo not restoring selection The built-in color scheme dropdown always showed "Custom" when reopening the profile editor. Two bugs were present: - color comparison was called as pointer-to-pointer comparison, which always fails. - gdk_rgba_equal does exact floating-point comparison, which is too strict for colors that have been round-tripped through GSettings string serialization. Using the fuzzy rgba_equal function fixes that. Fixes #486 --- src/profile-editor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/profile-editor.c') diff --git a/src/profile-editor.c b/src/profile-editor.c index f4959db..520a61b 100644 --- a/src/profile-editor.c +++ b/src/profile-editor.c @@ -380,8 +380,8 @@ profile_colors_notify_scheme_combo_cb (TerminalProfile *profile, { for (i = 0; i < G_N_ELEMENTS (color_schemes); ++i) { - if (gdk_rgba_equal (&fg, &color_schemes[i].foreground) && - gdk_rgba_equal (&bg, &color_schemes[i].background)) + if (rgba_equal (fg, &color_schemes[i].foreground) && + rgba_equal (bg, &color_schemes[i].background)) break; } } -- cgit v1.2.1