diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-09 11:12:05 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-09 11:12:05 -0500 |
commit | a8a0db3497280b50d3b1546a4dbbc3c840bd1637 (patch) | |
tree | 79070109149029ba4b0712931293c8db7b7bd549 /clients/flower.c | |
parent | 19dd1d7eb1dc99528028dac0a3b7650d786614ca (diff) |
window: Move button handler to widget
Diffstat (limited to 'clients/flower.c')
-rw-r--r-- | clients/flower.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clients/flower.c b/clients/flower.c index 4b6a872..18e2015 100644 --- a/clients/flower.c +++ b/clients/flower.c @@ -105,10 +105,12 @@ motion_handler(struct widget *widget, struct input *input, } static void -button_handler(struct window *window, +button_handler(struct widget *widget, struct input *input, uint32_t time, int button, int state, void *data) { + struct window *window = data; + if (state) window_move(window, input, time); } @@ -156,7 +158,8 @@ int main(int argc, char *argv[]) widget_set_motion_handler(window_get_widget(flower.window), motion_handler); - window_set_button_handler(flower.window, button_handler); + widget_set_button_handler(window_get_widget(flower.window), + button_handler); window_set_user_data(flower.window, &flower); display_run(d); |