[Spice-commits] 2 commits - gtk/channel-main.c gtk/channel-main.h gtk/map-file gtk/spice-glib-sym-file gtk/spice-widget.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Tue Apr 9 06:24:55 PDT 2013


 gtk/channel-main.c      |   37 +++++++++++++++++++++++++++++++------
 gtk/channel-main.h      |    2 ++
 gtk/map-file            |    1 +
 gtk/spice-glib-sym-file |    1 +
 gtk/spice-widget.c      |    4 ++--
 5 files changed, 37 insertions(+), 8 deletions(-)

New commits:
commit 439bfcc5553c8e906fd465bda185b24be4dd881f
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Mon Apr 8 18:19:35 2013 +0200

    widget: don't send current configuration back
    
    spice-gtk keep the main channel monitor configuration in sync, but
    shouldn't send back to the remote if disabled, as this may results in
    different settings, for example if the remote has switched to
    16 bits.

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 011c905..d260367 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -314,8 +314,8 @@ static void update_monitor_area(SpiceDisplay *display)
     }
 
     if (!d->resize_guest_enable)
-        spice_main_set_display(d->main, get_display_id(display),
-                               c->x, c->y, c->width, c->height);
+        spice_main_update_display(d->main, get_display_id(display),
+                                  c->x, c->y, c->width, c->height, FALSE);
 
     update_area(display, c->x, c->y, c->width, c->height);
     g_clear_pointer(&monitors, g_array_unref);
commit b44281a003640a650dc3d95466d62ec6f053c76e
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Mon Apr 8 18:18:44 2013 +0200

    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.

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


More information about the Spice-commits mailing list