compositor: Only configure surface when it changes geometry
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 21 Jul 2011 18:33:47 +0000 (11:33 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 22 Jul 2011 03:14:57 +0000 (20:14 -0700)
compositor/compositor.c

index 4afdea2..177de54 100644 (file)
@@ -1028,14 +1028,13 @@ surface_attach(struct wl_client *client,
                       &es->buffer_destroy_listener.link);
 
        if (es->visual == NULL)
-               fprintf(stderr, "initial attach for surface %p\n", surface);
-
-       if (es->visual == NULL)
                wl_list_insert(&es->compositor->surface_list, &es->link);
 
        es->visual = buffer->visual;
-       wlsc_surface_configure(es, es->x + x, es->y + y,
-                              buffer->width, buffer->height);
+       if (x != 0 || y != 0 ||
+           es->width != buffer->width || es->height != buffer->height)
+               wlsc_surface_configure(es, es->x + x, es->y + y,
+                                      buffer->width, buffer->height);
 
        wlsc_buffer_attach(buffer, surface);