summaryrefslogtreecommitdiff
path: root/src/keyevents.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-03-21 20:23:33 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-03-21 20:23:33 +0100
commit56dec873222e8881847ebcb246eaf67d69e4e86a (patch)
treeb5b92d0c160b005a5a49ade5ccb857376ceb4859 /src/keyevents.c
parent283618a4a2dbf9a9f64c98d120b88ff272a7d777 (diff)
Add method to forcefully disable antialiasing (closes GH-17)
Diffstat (limited to 'src/keyevents.c')
-rw-r--r--src/keyevents.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/keyevents.c b/src/keyevents.c
index 8e2b181..896087e 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -125,6 +125,7 @@ void init_keyevents(void) {
feh_set_kb(&keys.size_to_image, 0, XK_w , 0, 0 , 0, 0);
feh_set_kb(&keys.render , 0, XK_KP_Begin , 0, 0 , 0, 0);
feh_set_kb(&keys.toggle_actions, 0, XK_a, 0, 0, 0, 0);
+ feh_set_kb(&keys.toggle_aliasing, 0, XK_A, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_filenames, 0, XK_d, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_pointer, 0, XK_o, 0, 0, 0, 0);
feh_set_kb(&keys.toggle_caption, 0, XK_c, 0, 0, 0, 0);
@@ -245,6 +246,8 @@ void init_keyevents(void) {
cur_kb = &keys.render;
else if (!strcmp(action, "toggle_actions"))
cur_kb = &keys.toggle_actions;
+ else if (!strcmp(action, "toggle_aliasing"))
+ cur_kb = &keys.toggle_aliasing;
else if (!strcmp(action, "toggle_filenames"))
cur_kb = &keys.toggle_filenames;
else if (!strcmp(action, "toggle_pointer"))
@@ -424,19 +427,19 @@ void feh_event_handle_keypress(XEvent * ev)
}
else if (feh_is_kp(&keys.scroll_right, keysym, state)) {
winwid->im_x -= 20;
- winwidget_render_image(winwid, 0, 0);
+ winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_left, keysym, state)) {
winwid->im_x += 20;
- winwidget_render_image(winwid, 0, 0);
+ winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_down, keysym, state)) {
winwid->im_y -= 20;
- winwidget_render_image(winwid, 0, 0);
+ winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.scroll_up, keysym, state)) {
winwid->im_y += 20;
- winwidget_render_image(winwid, 0, 0);
+ winwidget_render_image(winwid, 0, 1);
}
else if (feh_is_kp(&keys.jump_back, keysym, state)) {
if (opt.slideshow)
@@ -505,7 +508,7 @@ void feh_event_handle_keypress(XEvent * ev)
winwid->im_y = (winwid->h / 2) - (((winwid->h / 2) - winwid->im_y) /
winwid->old_zoom * winwid->zoom);
winwidget_sanitise_offsets(winwid);
- winwidget_render_image(winwid, 0, 1);
+ winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.zoom_out, keysym, state)) {
winwid->old_zoom = winwid->zoom;
@@ -515,7 +518,7 @@ void feh_event_handle_keypress(XEvent * ev)
winwid->im_y = (winwid->h / 2) - (((winwid->h / 2) - winwid->im_y) /
winwid->old_zoom * winwid->zoom);
winwidget_sanitise_offsets(winwid);
- winwidget_render_image(winwid, 0, 1);
+ winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.zoom_default, keysym, state)) {
winwid->zoom = 1;
@@ -526,18 +529,22 @@ void feh_event_handle_keypress(XEvent * ev)
else if (feh_is_kp(&keys.zoom_fit, keysym, state)) {
feh_calc_needed_zoom(&winwid->zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h);
winwidget_center_image(winwid);
- winwidget_render_image(winwid, 0, 1);
+ winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.render, keysym, state)) {
- winwidget_render_image(winwid, 0, 1);
+ winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.toggle_actions, keysym, state)) {
opt.draw_actions = !opt.draw_actions;
- winwidget_rerender_all(0, 1);
+ winwidget_rerender_all(0);
+ }
+ else if (feh_is_kp(&keys.toggle_aliasing, keysym, state)) {
+ opt.force_aliasing = !opt.force_aliasing;
+ winwidget_rerender_all(0);
}
else if (feh_is_kp(&keys.toggle_filenames, keysym, state)) {
opt.draw_filename = !opt.draw_filename;
- winwidget_rerender_all(0, 1);
+ winwidget_rerender_all(0);
}
else if (feh_is_kp(&keys.toggle_pointer, keysym, state)) {
winwidget_set_pointer(winwid, opt.hide_pointer);
@@ -549,7 +556,7 @@ void feh_event_handle_keypress(XEvent * ev)
else if (feh_is_kp(&keys.toggle_caption, keysym, state)) {
if (opt.caption_path)
winwid->caption_entry = 1;
- winwidget_render_image(winwid, 0, 1);
+ winwidget_render_image(winwid, 0, 0);
}
else if (feh_is_kp(&keys.reload_image, keysym, state)) {
feh_reload_image(winwid, 0, 0);
@@ -614,7 +621,7 @@ void feh_event_handle_keypress(XEvent * ev)
winwid->full_screen = !winwid->full_screen;
winwidget_destroy_xwin(winwid);
winwidget_create_window(winwid, winwid->im_w, winwid->im_h);
- winwidget_render_image(winwid, 1, 1);
+ winwidget_render_image(winwid, 1, 0);
winwidget_show(winwid);
#ifdef HAVE_LIBXINERAMA
/* if we have xinerama and we're using it, then full screen the window