Skip to contentSkip to conversation

console: ignore ui_info updates which don't actually update something

PATCH New Gerd Hoffmann 1 participant 1 message May 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 console: ignore ui_info updates which don't actually update something

---
 ui/console.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
ui/console.c +6 -1
index 6402010..581480f 100644
@@ -1457,16 +1457,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;
 }
Signature · 1 line
1.8.3.1