[PATCH spice-server] red_worker: Do not sent empty monitor config message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1061942
---
 server/red_worker.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index e2feb23..a106923 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9144,7 +9144,6 @@ static void red_marshall_monitors_config(RedChannelClient *rcc, SpiceMarshaller
     SpiceMsgDisplayMonitorsConfig *msg = spice_malloc0(sizeof(*msg) + heads_size);
     int count = 0; // ignore monitors_config->count, it may contain zero width monitors, remove them now
 
-    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_MONITORS_CONFIG, NULL);
     for (i = 0 ; i < monitors_config->count; ++i) {
         if (monitors_config->heads[i].width == 0 || monitors_config->heads[i].height == 0) {
             continue;
@@ -9157,9 +9156,12 @@ static void red_marshall_monitors_config(RedChannelClient *rcc, SpiceMarshaller
         msg->heads[count].y = monitors_config->heads[i].y;
         count++;
     }
-    msg->count = count;
-    msg->max_allowed = monitors_config->max_allowed;
-    spice_marshall_msg_display_monitors_config(base_marshaller, msg);
+    if (count > 0) {
+        red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_MONITORS_CONFIG, NULL);
+        msg->count = count;
+        msg->max_allowed = monitors_config->max_allowed;
+        spice_marshall_msg_display_monitors_config(base_marshaller, msg);
+    }
     free(msg);
 }
 
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]