mirror of
https://github.com/swaywm/sway.git
synced 2025-11-04 13:29:52 -05:00
ipc: handle unnamed xkb_active_layout_name
If the active xkb_layout does not have a name, use `NULL` instead of `json_object_new_string(NULL)`. This also makes it so swaymsg will pretty print this as `(unnamed)`.
This commit is contained in:
parent
418c19fe52
commit
a64a3ee6bb
2 changed files with 3 additions and 3 deletions
|
|
@ -597,7 +597,7 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
|
|||
const char *layout =
|
||||
xkb_keymap_layout_get_name(keymap, layout_idx);
|
||||
json_object_object_add(object, "xkb_active_layout_name",
|
||||
json_object_new_string(layout));
|
||||
layout ? json_object_new_string(layout) : NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue