summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-05-13 13:51:13 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-05-16 10:43:32 -0400
commit12283cc9a205a25214e1e77bb0ef5114c0b31951 (patch)
tree8bc2e6240dba75758025297f85bdb01650dfbbb3
parentded9ff337b0444d5beb4a7f83f9222892a2506a8 (diff)
view: Set resize handler so fullscreen doesn't crash
-rw-r--r--clients/view.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clients/view.c b/clients/view.c
index 40614c03..406226a6 100644
--- a/clients/view.c
+++ b/clients/view.c
@@ -115,6 +115,16 @@ redraw_handler(struct window *window, void *data)
}
static void
+resize_handler(struct window *window,
+ int32_t width, int32_t height, void *data)
+{
+ struct view *view = data;
+
+ window_set_child_size(view->window, width, height);
+ window_schedule_redraw(window);
+}
+
+static void
view_page_up(struct view *view)
{
if(view->page <= 0)
@@ -233,6 +243,7 @@ view_create(struct display *display, uint32_t key, const char *filename)
window_set_user_data(view->window, view);
window_set_redraw_handler(view->window, redraw_handler);
+ window_set_resize_handler(view->window, resize_handler);
window_set_key_handler(view->window, key_handler);
window_set_keyboard_focus_handler(view->window,
keyboard_focus_handler);