lib: handle any potential changes to type

This commit is contained in:
Christian Hergert 2023-02-17 15:59:48 -08:00
parent 459cb173b0
commit f5935b38cf

View File

@ -129,6 +129,24 @@ mks_screen_console_notify_cb (MksScreen *self,
_mks_screen_set_height (self, mks_qemu_console_get_height (console)); _mks_screen_set_height (self, mks_qemu_console_get_height (console));
else if (strcmp (pspec->name, "number") == 0) else if (strcmp (pspec->name, "number") == 0)
_mks_screen_set_number (self, mks_qemu_console_get_head (console)); _mks_screen_set_number (self, mks_qemu_console_get_head (console));
else if (strcmp (pspec->name, "type") == 0)
{
const char *type;
if ((type = mks_qemu_console_get_type_ ((console))))
{
MksScreenKind kind = MKS_SCREEN_KIND_TEXT;
if (strcmp (type, "Graphic") == 0)
kind = MKS_SCREEN_KIND_GRAPHIC;
if (kind != self->kind)
{
self->kind = kind;
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_KIND]);
}
}
}
} }
static void static void