* OF THIS SOFTWARE.
*/
+#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
cairo_set_source_rgba(cr, 0, 0, 0, 0.8);
cairo_fill(cr);
+ cairo_rectangle(cr, allocation.x, allocation.y,
+ allocation.width, allocation.height);
+ cairo_clip(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) {
if (!dnd->items[i])
wl_surface_attach(dnd_drag->drag_surface, buffer, 0, 0);
wl_surface_damage(dnd_drag->drag_surface, 0, 0,
dnd_drag->width, dnd_drag->height);
+ wl_surface_commit(dnd_drag->drag_surface);
}
static void
cairo_t *cr;
pointer = display_get_pointer_image(dnd->display, CURSOR_DRAGGING);
+ if (!pointer) {
+ fprintf(stderr, "WARNING: grabbing cursor image not found\n");
+ pointer = display_get_pointer_image(dnd->display,
+ CURSOR_LEFT_PTR);
+ assert(pointer && "no cursor image found");
+ }
rectangle.width = item_width + 2 * pointer->width;
rectangle.height = item_height + 2 * pointer->height;
-dnd_drag->hotspot_x, -dnd_drag->hotspot_y);
wl_surface_damage(dnd_drag->drag_surface, 0, 0,
dnd_drag->width, dnd_drag->height);
+ wl_surface_commit(dnd_drag->drag_surface);
dnd->current_drag = dnd_drag;
window_schedule_redraw(dnd->window);
if (len == 0) {
return;
} else if (len != sizeof *message) {
- fprintf(stderr, "odd message length %ld, expected %ld\n",
+ fprintf(stderr, "odd message length %zu, expected %zu\n",
len, sizeof *message);
return;
}