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)
458
458
n -> colors .fg = invalid ;
459
459
n -> colors .bg = invalid ;
460
460
n -> colors .frame = invalid ;
461
-
462
461
n -> colors .highlight = NULL ;
463
462
464
463
n -> script_run = false;
Original file line number Diff line number Diff line change @@ -241,6 +241,11 @@ void rule_free(struct rule *r)
241
241
g_free (r -> set_stack_tag );
242
242
g_free (r -> new_icon );
243
243
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 )
244
249
gradient_free (r -> highlight );
245
250
}
246
251
Original file line number Diff line number Diff line change @@ -760,7 +760,12 @@ TEST test_dbus_notify_colors(void)
760
760
761
761
// Invalid color strings are ignored
762
762
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 ]));
764
769
765
770
dbus_notification_free (n_dbus );
766
771
You can’t perform that action at this time.
0 commit comments