summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/keyevents.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d21cd7..4bf4a4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ git HEAD
* Add --magick-timeout option to set imagemagick conversion timeout or
disable it altogether
* Clean up temporary / to-delete files when receiveng SIG{INT,TERM,QUIT}
+ * Do not scroll past image borders when using key bindings
Tue, 06 Mar 2012 13:13:35 +0100 Daniel Friesel <derf@finalrewind.org>
diff --git a/src/keyevents.c b/src/keyevents.c
index 6327320..343b5d1 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -479,34 +479,42 @@ void feh_event_handle_keypress(XEvent * ev)
}
else if (feh_is_kp(&keys.scroll_right, keysym, state)) {
winwid->im_x -= 20;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_left, keysym, state)) {
winwid->im_x += 20;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_down, keysym, state)) {
winwid->im_y -= 20;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_up, keysym, state)) {
winwid->im_y += 20;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_right_page, keysym, state)) {
winwid->im_x -= winwid->w;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.scroll_left_page, keysym, state)) {
winwid->im_x += winwid->w;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.scroll_down_page, keysym, state)) {
winwid->im_y -= winwid->h;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.scroll_up_page, keysym, state)) {
winwid->im_y += winwid->h;
+ winwidget_sanitise_offsets(winwid);
winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.jump_back, keysym, state)) {