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

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

 



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@xxxxxxxxxx>
---
 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

_______________________________________________
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]