summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-06-27 17:06:34 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-07-16 17:46:41 +0200
commitfe842771b2e2400fbc5ba8efd74550cde44276ee (patch)
tree7ec474ff6c52939ac5ee3ee72c884930c65748c9
parent4ea133feb82c83a0ed0daaad381101b0afd5f3a5 (diff)
Handle MonitorsConfig::max_allowed
-rw-r--r--gtk/channel-display.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 637a6cf..d77447a 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -72,6 +72,7 @@ struct _SpiceDisplayChannelPrivate {
gboolean mark;
guint mark_false_event_id;
GArray *monitors;
+ guint monitors_max;
#ifdef WIN32
HDC dc;
#endif
@@ -84,7 +85,8 @@ enum {
PROP_0,
PROP_WIDTH,
PROP_HEIGHT,
- PROP_MONITORS
+ PROP_MONITORS,
+ PROP_MONITORS_MAX
};
enum {
@@ -177,6 +179,10 @@ static void spice_display_get_property(GObject *object,
g_value_set_boxed(value, c->monitors);
break;
}
+ case PROP_MONITORS_MAX: {
+ g_value_set_uint(value, c->monitors_max);
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -256,6 +262,24 @@ static void spice_display_channel_class_init(SpiceDisplayChannelClass *klass)
G_PARAM_STATIC_STRINGS));
/**
+ * SpiceDisplayChannel:monitors-max:
+ *
+ * The maximum number of monitors the server or guest supports.
+ * May change during client lifetime, for instance guest may
+ * reboot or dynamically adjust this.
+ *
+ * Since: 0.13
+ */
+ g_object_class_install_property
+ (gobject_class, PROP_MONITORS_MAX,
+ g_param_spec_uint("monitors-max",
+ "Max display monitors",
+ "The current maximum number of monitors",
+ 1, G_MAXINT16, 1,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
* SpiceDisplayChannel::display-primary-create:
* @display: the #SpiceDisplayChannel that emitted the signal
* @format: %SPICE_SURFACE_FMT_32_xRGB or %SPICE_SURFACE_FMT_16_555;
@@ -1479,8 +1503,9 @@ static void display_handle_monitors_config(SpiceChannel *channel, SpiceMsgIn *in
g_return_if_fail(config != NULL);
g_return_if_fail(config->count > 0);
- SPICE_DEBUG("monitors config: n: %d", config->count);
+ SPICE_DEBUG("monitors config: n: %d/%d", config->count, config->max_allowed);
+ c->monitors_max = config->max_allowed;
c->monitors = g_array_set_size(c->monitors, config->count);
for (i = 0; i < config->count; i++) {