projects
/
profile
/
ivi
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0043961
)
clients/view: Do not browse outside document range
author
Tim Wiederhake
<twied@gmx.net>
Tue, 25 Jan 2011 21:21:55 +0000
(22:21 +0100)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Tue, 25 Jan 2011 21:29:27 +0000
(16:29 -0500)
clients/view.c
patch
|
blob
|
history
diff --git
a/clients/view.c
b/clients/view.c
index
88c59ad
..
9e19a5a
100644
(file)
--- 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: