summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-03-27 16:44:57 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-03-27 16:45:13 -0400
commit679f716088845c54fff3e0c9a9d318a3e9e94e2e (patch)
treec89c14bcade4ca2e9ae0bdc4d200800c3dd2a409
parenta8ae8a91351243fa8e07198fa29fe90f9588e722 (diff)
dnd: Damage surface after attaching new buffer
-rw-r--r--clients/dnd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clients/dnd.c b/clients/dnd.c
index 2b0faaa..91a7365 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -53,6 +53,7 @@ struct dnd_drag {
uint32_t time;
struct item *item;
int x_offset, y_offset;
+ int width, height;
const char *mime_type;
struct wl_surface *drag_surface;
@@ -256,6 +257,8 @@ data_source_target(void *data,
buffer = display_get_buffer_for_surface(dnd->display, surface);
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);
}
static void
@@ -347,6 +350,8 @@ create_drag_cursor(struct dnd_drag *dnd_drag,
dnd_drag->hotspot_x = pointer_width + x - item->x;
dnd_drag->hotspot_y = pointer_height + y - item->y;
+ dnd_drag->width = rectangle.width;
+ dnd_drag->height = rectangle.height;
return surface;
}
@@ -418,6 +423,8 @@ dnd_button_handler(struct widget *widget,
buffer = display_get_buffer_for_surface(dnd->display, dnd_drag->translucent);
wl_surface_attach(dnd_drag->drag_surface, buffer,
-dnd_drag->hotspot_x, -dnd_drag->hotspot_y);
+ wl_surface_damage(dnd_drag->drag_surface, 0, 0,
+ dnd_drag->width, dnd_drag->height);
window_schedule_redraw(dnd->window);
}