From f5935b38cf0d44c9e56d5010ccbf30982f12855f Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 17 Feb 2023 15:59:48 -0800 Subject: [PATCH] lib: handle any potential changes to type --- lib/mks-screen.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/mks-screen.c b/lib/mks-screen.c index 57f0c49..27d3a56 100644 --- a/lib/mks-screen.c +++ b/lib/mks-screen.c @@ -129,6 +129,24 @@ mks_screen_console_notify_cb (MksScreen *self, _mks_screen_set_height (self, mks_qemu_console_get_height (console)); else if (strcmp (pspec->name, "number") == 0) _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