[Spice-devel] [PATCH spice-gtk 1/3] spice-widget: Ignore duplicate configure events

Hans de Goede hdegoede at redhat.com
Thu Mar 14 14:32:54 PDT 2013


gtk seems to be sending us identical / repeated configure events quite
regularly (atleast under X11), we don't care about re-configures with the
same size + coordinates, so filter these out.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/spice-widget.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index e4c64ee..ff76498 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1654,12 +1654,20 @@ static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *conf)
     SpiceDisplay *display = SPICE_DISPLAY(widget);
     SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
 
+    if (conf->width == d->ww && conf->height == d->wh &&
+            conf->x == d->mx && conf->y == d->my) {
+        return true;
+    }
+
     if (conf->width != d->ww  || conf->height != d->wh) {
         d->ww = conf->width;
         d->wh = conf->height;
         recalc_geometry(widget);
     }
 
+    d->mx = conf->x;
+    d->my = conf->y;
+
     try_mouse_ungrab(display);
     try_mouse_grab(display);
 
-- 
1.8.1.4



More information about the Spice-devel mailing list