diff options
Diffstat (limited to 'ui/input.c')
-rw-r--r-- | ui/input.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -571,7 +571,7 @@ void qemu_remove_mouse_mode_change_notifier(Notifier *notify) MouseInfoList *qmp_query_mice(Error **errp) { MouseInfoList *mice_list = NULL; - MouseInfoList *info; + MouseInfo *info; QemuInputHandlerState *s; bool current = true; @@ -581,16 +581,14 @@ MouseInfoList *qmp_query_mice(Error **errp) continue; } - info = g_new0(MouseInfoList, 1); - info->value = g_new0(MouseInfo, 1); - info->value->index = s->id; - info->value->name = g_strdup(s->handler->name); - info->value->absolute = s->handler->mask & INPUT_EVENT_MASK_ABS; - info->value->current = current; + info = g_new0(MouseInfo, 1); + info->index = s->id; + info->name = g_strdup(s->handler->name); + info->absolute = s->handler->mask & INPUT_EVENT_MASK_ABS; + info->current = current; current = false; - info->next = mice_list; - mice_list = info; + QAPI_LIST_PREPEND(mice_list, info); } return mice_list; |