swaynag: address some more of sircmpwn's comments

Fixes segfauls for any case where swaynag->outputs was not inititalized
including -h/--help, -v/--version, and invalid arguments.

Sets sane defaults for colors not given. Any color not given will
fallback to the default color values for type error.

Adds support for a hidpi cursor
This commit is contained in:
Brian Ashworth 2018-07-30 13:52:02 -04:00
parent 0ef3988438
commit 4f5cf330c8
3 changed files with 41 additions and 29 deletions

View file

@ -19,6 +19,11 @@ void swaynag_types_add_default(list_t *types) {
type_defaults->anchors = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
| ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT
| ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
type_defaults->button_background = 0x680A0AFF;
type_defaults->background = 0x900000FF;
type_defaults->text = 0xFFFFFFFF;
type_defaults->border = 0xD92424FF;
type_defaults->border_bottom = 0x470909FF;
type_defaults->bar_border_thickness = 2;
type_defaults->message_padding = 8;
type_defaults->details_border_thickness = 3;
@ -32,11 +37,6 @@ void swaynag_types_add_default(list_t *types) {
struct swaynag_type *type_error;
type_error = calloc(1, sizeof(struct swaynag_type));
type_error->name = strdup("error");
type_error->button_background = 0x680A0AFF;
type_error->background = 0x900000FF;
type_error->text = 0xFFFFFFFF;
type_error->border = 0xD92424FF;
type_error->border_bottom = 0x470909FF;
list_add(types, type_error);
struct swaynag_type *type_warning;