File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,6 @@ struct notification *notification_create(void)
458458 n -> colors .fg = invalid ;
459459 n -> colors .bg = invalid ;
460460 n -> colors .frame = invalid ;
461-
462461 n -> colors .highlight = NULL ;
463462
464463 n -> script_run = false;
Original file line number Diff line number Diff line change @@ -241,6 +241,11 @@ void rule_free(struct rule *r)
241241 g_free (r -> set_stack_tag );
242242 g_free (r -> new_icon );
243243 g_free (r -> name );
244+
245+ // Ugly but necessary
246+ if (r -> highlight != settings .colors_low .highlight &&
247+ r -> highlight != settings .colors_norm .highlight &&
248+ r -> highlight != settings .colors_crit .highlight )
244249 gradient_free (r -> highlight );
245250}
246251
Original file line number Diff line number Diff line change @@ -760,7 +760,12 @@ TEST test_dbus_notify_colors(void)
760760
761761 // Invalid color strings are ignored
762762 ASSERTm ("Invalid color strings should not change the color struct" , COLOR_SAME (n -> colors .bg , settings .colors_norm .bg ));
763- ASSERTm ("Invalid color strings should not change the gradient struct" , n -> colors .highlight == settings .colors_norm .highlight );
763+
764+ ASSERTm ("Invalid color strings should not change the gradient struct" , n -> colors .highlight -> length == settings .colors_norm .highlight -> length );
765+
766+ for (int i = 0 ; i < settings .colors_norm .highlight -> length ; i ++ )
767+ ASSERTm ("Invalid color strings should not change the gradient struct" ,
768+ COLOR_SAME (n -> colors .highlight -> colors [i ], settings .colors_norm .highlight -> colors [i ]));
764769
765770 dbus_notification_free (n_dbus );
766771
You can’t perform that action at this time.
0 commit comments