summaryrefslogtreecommitdiff
path: root/clients/dnd.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-01-10 12:23:19 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-01-10 14:22:10 -0500
commitb67e94b17083e014085c582ebb4b691aa700ea5e (patch)
tree29730dca72f0b68510500cd59ff22783ab6569b4 /clients/dnd.c
parent5d12990dbecea205f095a17d02fdb952ba22cf13 (diff)
window: Make resize and redraw handlers widget vfuncs
Diffstat (limited to 'clients/dnd.c')
-rw-r--r--clients/dnd.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/clients/dnd.c b/clients/dnd.c
index cd03b1fa..0498c5d6 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -160,8 +160,9 @@ item_create(struct display *display, int x, int y, int seed)
}
static void
-dnd_draw(struct dnd *dnd)
+dnd_redraw_handler(struct widget *widget, void *data)
{
+ struct dnd *dnd = data;
struct rectangle allocation;
cairo_t *cr;
cairo_surface_t *surface;
@@ -192,14 +193,6 @@ dnd_draw(struct dnd *dnd)
}
static void
-redraw_handler(struct window *window, void *data)
-{
- struct dnd *dnd = data;
-
- dnd_draw(dnd);
-}
-
-static void
keyboard_focus_handler(struct window *window,
struct input *device, void *data)
{
@@ -530,12 +523,12 @@ dnd_create(struct display *display)
}
window_set_user_data(dnd->window, dnd);
- window_set_redraw_handler(dnd->window, redraw_handler);
window_set_keyboard_focus_handler(dnd->window,
keyboard_focus_handler);
window_set_data_handler(dnd->window, dnd_data_handler);
window_set_drop_handler(dnd->window, dnd_drop_handler);
+ widget_set_redraw_handler(dnd->widget, dnd_redraw_handler);
widget_set_enter_handler(dnd->widget, dnd_enter_handler);
widget_set_motion_handler(dnd->widget, dnd_motion_handler);
widget_set_button_handler(dnd->widget, dnd_button_handler);
@@ -544,7 +537,7 @@ dnd_create(struct display *display)
height = 4 * (item_height + item_padding) + item_padding;
window_set_child_size(dnd->window, width, height);
- dnd_draw(dnd);
+ window_schedule_redraw(dnd->window);
return dnd;
}