summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2013-04-08 18:18:44 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2013-04-09 15:24:47 +0200
commitb44281a003640a650dc3d95466d62ec6f053c76e (patch)
tree36b19078b5cdf5ff302121394b29bd83292f579d
parentdb0a525588970859b67cf44c071c849b638f6eec (diff)
main: add spice_main_update_display()
Allow to change locally display resolution without sending it to remote, this is useful to keep local information without bothering the remote.
-rw-r--r--gtk/channel-main.c37
-rw-r--r--gtk/channel-main.h2
-rw-r--r--gtk/map-file1
-rw-r--r--gtk/spice-glib-sym-file1
4 files changed, 35 insertions, 6 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 11cd0f9..1585f1d 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -2382,19 +2382,25 @@ gboolean spice_main_agent_test_capability(SpiceMainChannel *channel, guint32 cap
}
/**
- * spice_main_set_display:
+ * spice_main_update_display:
* @channel:
* @id: display ID
* @x: x position
* @y: y position
* @width: display width
* @height: display height
+ * @update: if %TRUE, update guest resolution after 1sec.
*
- * Notify the guest of screen resolution change. The notification is
- * sent 1 second later, if no further changes happen.
+ * Update the display @id resolution.
+ *
+ * If @update is %TRUE, the remote configuration will be updated too
+ * after 1 second without further changes. You can send when you want
+ * without delay the new configuration to the remote with
+ * spice_main_send_monitor_config()
**/
-void spice_main_set_display(SpiceMainChannel *channel, int id,
- int x, int y, int width, int height)
+void spice_main_update_display(SpiceMainChannel *channel, int id,
+ int x, int y, int width, int height,
+ gboolean update)
{
SpiceMainChannelPrivate *c;
@@ -2414,7 +2420,26 @@ void spice_main_set_display(SpiceMainChannel *channel, int id,
c->display[id].width = width;
c->display[id].height = height;
- update_display_timer(channel, 1);
+ if (update)
+ update_display_timer(channel, 1);
+}
+
+/**
+ * spice_main_set_display:
+ * @channel:
+ * @id: display ID
+ * @x: x position
+ * @y: y position
+ * @width: display width
+ * @height: display height
+ *
+ * Notify the guest of screen resolution change. The notification is
+ * sent 1 second later, if no further changes happen.
+ **/
+void spice_main_set_display(SpiceMainChannel *channel, int id,
+ int x, int y, int width, int height)
+{
+ spice_main_update_display(channel, id, x, y, width, height, TRUE);
}
/**
diff --git a/gtk/channel-main.h b/gtk/channel-main.h
index adba0a2..3e4fc42 100644
--- a/gtk/channel-main.h
+++ b/gtk/channel-main.h
@@ -69,6 +69,8 @@ GType spice_main_channel_get_type(void);
void spice_main_set_display(SpiceMainChannel *channel, int id,
int x, int y, int width, int height);
+void spice_main_update_display(SpiceMainChannel *channel, int id,
+ int x, int y, int width, int height, gboolean update);
void spice_main_set_display_enabled(SpiceMainChannel *channel, int id, gboolean enabled);
gboolean spice_main_send_monitor_config(SpiceMainChannel *channel);
diff --git a/gtk/map-file b/gtk/map-file
index 4d05597..386afb1 100644
--- a/gtk/map-file
+++ b/gtk/map-file
@@ -69,6 +69,7 @@ spice_main_clipboard_selection_request;
spice_main_send_monitor_config;
spice_main_set_display;
spice_main_set_display_enabled;
+spice_main_update_display;
spice_playback_channel_get_type;
spice_playback_channel_set_delay;
spice_port_channel_get_type;
diff --git a/gtk/spice-glib-sym-file b/gtk/spice-glib-sym-file
index 28b54af..ac8ee82 100644
--- a/gtk/spice-glib-sym-file
+++ b/gtk/spice-glib-sym-file
@@ -45,6 +45,7 @@ spice_main_clipboard_selection_request
spice_main_send_monitor_config
spice_main_set_display
spice_main_set_display_enabled
+spice_main_update_display
spice_playback_channel_get_type
spice_playback_channel_set_delay
spice_port_channel_get_type