console: ignore ui_info updates which don't actually update something
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 30 May 2016 08:41:13 +0000 (10:41 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 10 Jun 2016 09:16:18 +0000 (11:16 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1464597673-26464-1-git-send-email-kraxel@redhat.com

ui/console.c

index bf385790b57b4050e67c2a23055031d6f34d9372..ce1e10570f22a165d50bad75353c23b44c40747e 100644 (file)
@@ -1453,16 +1453,21 @@ bool dpy_ui_info_supported(QemuConsole *con)
 int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info)
 {
     assert(con != NULL);
-    con->ui_info = *info;
+
     if (!dpy_ui_info_supported(con)) {
         return -1;
     }
+    if (memcmp(&con->ui_info, info, sizeof(con->ui_info)) == 0) {
+        /* nothing changed -- ignore */
+        return 0;
+    }
 
     /*
      * Typically we get a flood of these as the user resizes the window.
      * Wait until the dust has settled (one second without updates), then
      * go notify the guest.
      */
+    con->ui_info = *info;
     timer_mod(con->ui_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1000);
     return 0;
 }