diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-30 15:09:49 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-30 15:09:49 -0400 |
commit | a369ff52739e8bca84faa6de9c4115f3e84ef818 (patch) | |
tree | 31892c50b41fccb96dbe4ec03ca2aa525ace5c62 /clients | |
parent | 1bdb477522ee364ca660064e8ca232fbdece09f6 (diff) | |
download | weston-a369ff52739e8bca84faa6de9c4115f3e84ef818.tar.gz weston-a369ff52739e8bca84faa6de9c4115f3e84ef818.tar.bz2 weston-a369ff52739e8bca84faa6de9c4115f3e84ef818.zip |
image: Set resize handler and center view on resize/fullscreen
Diffstat (limited to 'clients')
-rw-r--r-- | clients/image.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clients/image.c b/clients/image.c index 14f05507..2804dbf1 100644 --- a/clients/image.c +++ b/clients/image.c @@ -161,6 +161,15 @@ redraw_handler(struct widget *widget, void *data) } static void +resize_handler(struct widget *widget, + int32_t width, int32_t height, void *data) +{ + struct image *image = data; + + center_view(image); +} + +static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { @@ -363,6 +372,7 @@ image_create(struct display *display, const char *filename, window_set_user_data(image->window, image); widget_set_redraw_handler(image->widget, redraw_handler); + widget_set_resize_handler(image->widget, resize_handler); window_set_keyboard_focus_handler(image->window, keyboard_focus_handler); window_set_fullscreen_handler(image->window, fullscreen_handler); |