static void update_enabled(VirtViewerDisplay *self, gboolean enabled, gboolean send)
{
    SpiceMainChannel *main_channel = get_main(self);
    guint nth;

    /* this may happen when finalizing */
    if (!main_channel)
        return;

    g_object_get(self, "nth-display", &nth, NULL);
    spice_main_update_display_enabled(main_channel, nth, enabled, send);
}
static void
show_hint_changed(VirtViewerDisplay *self)
{
    SpiceMainChannel *main_channel = get_main(self);
    guint enabled = TRUE;
    guint nth, hint = virt_viewer_display_get_show_hint(self);

    /* this may happen when finalizing */
    if (!main_channel)
        return;

    g_object_get(self, "nth-display", &nth, NULL);
    if (!(hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_SET) ||
        hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED)
        enabled = FALSE;

    spice_main_set_display_enabled(main_channel, nth, enabled);
}