int x, y;
bool mapped;
+ bool placed;
};
static bool server_init(struct tinyds_server *server,
view_handle_surface_commit(struct wl_listener *listener, void *data)
{
struct tinyds_view *view;
+ struct ds_buffer *buffer;
+ int w = 0, h = 0;
view = wl_container_of(listener, view, surface_commit);
+
+ buffer = ds_surface_get_buffer(
+ ds_xdg_surface_get_surface(view->xdg_surface));
+ if (!view->placed && buffer) {
+ view->placed = true;
+
+ ds_buffer_get_size(buffer, &w, &h);
+
+ view->x = rand() % (OUTPUT_WIDTH - w);
+ view->y = rand() % (OUTPUT_HEIGHT - h);
+ }
+
output_damage(view->server->output);
}
src_image,
NULL,
dst_image,
- 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, view->x, view->y,
pixman_image_get_width(src_image),
pixman_image_get_height(src_image));
pixman_image_unref(src_image);