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-13 13:51:13 -0400
commitb4c5ba083706d5e251c48388805dd53ac163f976 (patch)
tree72f52da56f36b8df71cbdad7b002e728e971f14c
parent5956157c8c9cc0b1a1cfcaf9ff4273f06d9a5cd7 (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);