summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2011-01-25 22:21:55 +0100
committerKristian Høgsberg <krh@bitplanet.net>2011-01-25 16:29:27 -0500
commit1afc9a98fa918764167015d96ee2a730cb123715 (patch)
tree84f657f45efecdf5ca5b09daf9f72a55acd9b50d /clients
parent00439617f395742432f08d5fe1563c2fc2b1439a (diff)
clients/view: Do not browse outside document range
Diffstat (limited to 'clients')
-rw-r--r--clients/view.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/clients/view.c b/clients/view.c
index 88c59ad..9e19a5a 100644
--- a/clients/view.c
+++ b/clients/view.c
@@ -127,14 +127,20 @@ key_handler(struct window *window, struct input *input, uint32_t time,
case KEY_PAGEDOWN:
if (!state)
break;
- view->page++;
+
+ if (view->page + 1 < poppler_document_get_n_pages(view->document))
+ view->page++;
+
window_schedule_redraw(view->window);
break;
case KEY_BACKSPACE:
case KEY_PAGEUP:
if (!state)
break;
- view->page--;
+
+ if(view->page > 0)
+ view->page--;
+
window_schedule_redraw(view->window);
break;
default: