[Spice-devel] [PATCH spice-gtk 2/4] main: send only pending monitor config changes

Marc-André Lureau marcandre.lureau at redhat.com
Thu Apr 2 14:25:43 PDT 2015


When agent is ready, do not send current monitor configuration
immediately unless there are pending changes.
---
 gtk/channel-main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 3150208..c132ffa 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1290,8 +1290,11 @@ static gboolean timer_set_display(gpointer data)
     SpiceSession *session;
     gint i;
 
-    if (!c->agent_connected)
+    c->display_timer_id = 0;
+    if (!c->agent_connected) {
+        c->display_timer_id = -1;
         return FALSE;
+    }
 
     session = spice_channel_get_session(SPICE_CHANNEL(channel));
 
@@ -1789,7 +1792,9 @@ static void main_agent_handle_msg(SpiceChannel *channel,
         }
         c->agent_caps_received = true;
         g_coroutine_signal_emit(self, signals[SPICE_MAIN_AGENT_UPDATE], 0);
-        update_display_timer(SPICE_MAIN_CHANNEL(channel), 0);
+
+        if (c->display_timer_id)
+            update_display_timer(SPICE_MAIN_CHANNEL(channel), 0);
 
         if (caps->request)
             agent_announce_caps(self);
-- 
2.1.0



More information about the Spice-devel mailing list