From fb53f24b4f0e4e6da4cefd9d72aa54a5fb0135ee Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 4 Dec 2012 06:26:55 +0100 Subject: --bg-max: Respect --image-bg setting --- ChangeLog | 1 + src/wallpaper.c | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9645aaf..0d59278 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ git HEAD * Do not apply --scale-down to the thumbnail window. It will be applied to windows opened from this, though. * Patch by Rob Cornish: Respect --image-bg when setting a wallpaper + * Fix --bg-max not respecting --image-bg setting (thanks, 12qu) Tue, 16 Oct 2012 06:29:58 +0200 Daniel Friesel diff --git a/src/wallpaper.c b/src/wallpaper.c index df78303..30c3925 100644 --- a/src/wallpaper.c +++ b/src/wallpaper.c @@ -190,6 +190,9 @@ static void feh_wm_set_bg_maxed(Pixmap pmap, Imlib_Image im, int use_filelist, void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, int filled, int desktop, int use_filelist) { + XGCValues gcvalues; + XGCValues gcval; + GC gc; char bgname[20]; int num = (int) rand(); char bgfil[4096]; @@ -264,8 +267,6 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, Display *disp2; Window root2; int depth2; - XGCValues gcvalues; - GC gc; int in, out, w, h; if (opt.xinerama) @@ -322,8 +323,6 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, 0, 0, scr->width, scr->height); fehbg = estrjoin(" ", "feh", fehbg_xinerama, "--bg-scale", filbuf, NULL); } else if (centered) { - XGCValues gcval; - GC gc; D(("centering\n")); @@ -368,14 +367,12 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, fehbg = estrjoin(" ", "feh", fehbg_xinerama, "--bg-fill", filbuf, NULL); } else if (filled == 2) { - XGCValues gcval; pmap_d1 = XCreatePixmap(disp, root, scr->width, scr->height, depth); if (opt.image_bg == IMAGE_BG_WHITE) gcval.foreground = WhitePixel(disp, DefaultScreen(disp)); else gcval.foreground = BlackPixel(disp, DefaultScreen(disp)); - gcval.foreground = BlackPixel(disp, DefaultScreen(disp)); gc = XCreateGC(disp, root, GCForeground, &gcval); XFillRectangle(disp, pmap_d1, gc, 0, 0, scr->width, scr->height); -- cgit v1.2.3 From f40b636b137b7d779c12f8bebd3203c747307b12 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 6 Dec 2012 13:05:47 +0100 Subject: update ChangeLog --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0d59278..63c51d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,8 @@ git HEAD * Do not apply --scale-down to the thumbnail window. It will be applied to windows opened from this, though. * Patch by Rob Cornish: Respect --image-bg when setting a wallpaper - * Fix --bg-max not respecting --image-bg setting (thanks, 12qu) + (bg-center and bg-max) + * Add %V (feh process ID) format specifier Tue, 16 Oct 2012 06:29:58 +0200 Daniel Friesel -- cgit v1.2.3 From fcd11729ed161588e7ca60e7c5023ae56672a1e3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 6 Dec 2012 13:50:53 +0100 Subject: work around last image deletion bug with --cycle-once (closes #107) --- src/slideshow.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/slideshow.c b/src/slideshow.c index 7dcf791..d79c859 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -555,6 +555,14 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete) gib_list *doomed; doomed = current_file; + /* + * work around feh_list_jump exiting if cycle_once is enabled + * and no further files are left (we need to delete first) + */ + if (opt.cycle_once && ! doomed->next && do_delete) { + feh_file_rm_and_free(filelist, doomed); + exit(0); + } slideshow_change_image(winwid, SLIDE_NEXT, 0); if (do_delete) filelist = feh_file_rm_and_free(filelist, doomed); -- cgit v1.2.3 From a2280a5e8fbe4d53ce30ac3074c5e15b58e20151 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 6 Dec 2012 17:45:59 +0100 Subject: changelog. again. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 63c51d9..524fdd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,14 @@ git HEAD * Do not apply --scale-down to the thumbnail window. It will be applied to windows opened from this, though. + * Patch by Rob Cornish: Respect --image-bg when setting a wallpaper (bg-center and bg-max) + * Add %V (feh process ID) format specifier + + * Fix delete not working on last image with --cycle-once + Tue, 16 Oct 2012 06:29:58 +0200 Daniel Friesel -- cgit v1.2.3 From cdf7b73a45a9463243d48d25e3fc55586263418c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 8 Dec 2012 21:54:10 +0100 Subject: feh(1): Document save_image and save_filelist filename format (#112) --- man/feh.pre | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man/feh.pre b/man/feh.pre index 701e399..81a5cd6 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -1060,7 +1060,8 @@ Toggle filename display . .It f Bq save_filelist . -Save the current filelist to a unique filename +Save the current filelist as +.Qq feh_PID_ID_filelist . .It h Bq toggle_pause . @@ -1102,7 +1103,8 @@ Reload current image. Useful for webcams . .It s Bq save_image . -Save the current image to a unique filename +Save the current image as +.Qq feh_PID_ID_FILENAME . .It v Bq toggle_fullscreen . -- cgit v1.2.3 From 51dabb8eea5c8dc19b4bb2c598171f7092ffb72b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 9 Dec 2012 15:08:47 +0100 Subject: update test images (damn Xephyr / X11 changes) --- test/scr/caption_done | Bin 6514 -> 6262 bytes test/scr/caption_none | Bin 6525 -> 4285 bytes test/scr/draw_action | Bin 5551 -> 5328 bytes test/scr/draw_action_tinted | Bin 5884 -> 5628 bytes test/scr/draw_all_multi | Bin 7125 -> 6856 bytes test/scr/draw_all_one | Bin 6924 -> 6658 bytes test/scr/draw_filename | Bin 5233 -> 5022 bytes test/scr/draw_filename_action | Bin 6098 -> 5855 bytes test/scr/draw_filename_action_tinted | Bin 6547 -> 6277 bytes test/scr/draw_filename_tinted | Bin 5429 -> 5200 bytes test/scr/draw_info | Bin 5511 -> 5293 bytes test/scr/draw_info_tinted | Bin 5769 -> 5522 bytes test/scr/draw_nothing | Bin 6525 -> 4285 bytes test/scr/feh_full_lwi | Bin 17898 -> 10533 bytes test/scr/feh_lhi | Bin 13552 -> 10558 bytes test/scr/feh_lhi_i | Bin 34338 -> 23044 bytes test/scr/feh_lhi_ii | Bin 71938 -> 47242 bytes test/scr/feh_lhi_iir | Bin 15431 -> 12460 bytes test/scr/feh_lhi_iirr | Bin 15400 -> 12463 bytes test/scr/feh_lhi_iirri | Bin 63970 -> 40868 bytes test/scr/feh_lhi_iirrio | Bin 72012 -> 47314 bytes test/scr/feh_lhi_o | Bin 20132 -> 14486 bytes test/scr/feh_lhi_oo | Bin 32053 -> 21068 bytes test/scr/feh_lhi_ooo | Bin 136692 -> 93091 bytes test/scr/feh_lwi | Bin 19070 -> 15111 bytes test/scr/feh_lwi_scroll_r | Bin 19066 -> 15040 bytes test/scr/feh_lwi_scroll_rd | Bin 19075 -> 15063 bytes test/scr/feh_lwi_scroll_rdr | Bin 19188 -> 15162 bytes test/scr/feh_lwi_scroll_rdru | Bin 19143 -> 15106 bytes test/scr/feh_lwi_scroll_rdrul | Bin 19066 -> 15040 bytes test/scr/feh_scaledown_lwi | Bin 19203 -> 10692 bytes test/scr/geometry_offset_only | Bin 570 -> 629 bytes test/scr/index_full_h400 | Bin 3180 -> 2853 bytes test/scr/index_full_w400 | Bin 2135 -> 1944 bytes test/scr/index_h400 | Bin 1694 -> 1402 bytes test/scr/index_w400 | Bin 1159 -> 1047 bytes test/scr/thumbnail_default | Bin 1159 -> 1047 bytes 37 files changed, 0 insertions(+), 0 deletions(-) diff --git a/test/scr/caption_done b/test/scr/caption_done index 16a2311..9770be1 100644 Binary files a/test/scr/caption_done and b/test/scr/caption_done differ diff --git a/test/scr/caption_none b/test/scr/caption_none index 5903c34..9da5a5a 100644 Binary files a/test/scr/caption_none and b/test/scr/caption_none differ diff --git a/test/scr/draw_action b/test/scr/draw_action index 05677df..de41eef 100644 Binary files a/test/scr/draw_action and b/test/scr/draw_action differ diff --git a/test/scr/draw_action_tinted b/test/scr/draw_action_tinted index c45ae17..e19954a 100644 Binary files a/test/scr/draw_action_tinted and b/test/scr/draw_action_tinted differ diff --git a/test/scr/draw_all_multi b/test/scr/draw_all_multi index 0d0ab06..34f38cd 100644 Binary files a/test/scr/draw_all_multi and b/test/scr/draw_all_multi differ diff --git a/test/scr/draw_all_one b/test/scr/draw_all_one index 27419df..b7e6604 100644 Binary files a/test/scr/draw_all_one and b/test/scr/draw_all_one differ diff --git a/test/scr/draw_filename b/test/scr/draw_filename index 91d3c5d..2ade91d 100644 Binary files a/test/scr/draw_filename and b/test/scr/draw_filename differ diff --git a/test/scr/draw_filename_action b/test/scr/draw_filename_action index 615cd8e..5a31768 100644 Binary files a/test/scr/draw_filename_action and b/test/scr/draw_filename_action differ diff --git a/test/scr/draw_filename_action_tinted b/test/scr/draw_filename_action_tinted index 729a071..476fe71 100644 Binary files a/test/scr/draw_filename_action_tinted and b/test/scr/draw_filename_action_tinted differ diff --git a/test/scr/draw_filename_tinted b/test/scr/draw_filename_tinted index bd188ab..d73bf6f 100644 Binary files a/test/scr/draw_filename_tinted and b/test/scr/draw_filename_tinted differ diff --git a/test/scr/draw_info b/test/scr/draw_info index cf198da..371ed84 100644 Binary files a/test/scr/draw_info and b/test/scr/draw_info differ diff --git a/test/scr/draw_info_tinted b/test/scr/draw_info_tinted index 55e3a59..761122f 100644 Binary files a/test/scr/draw_info_tinted and b/test/scr/draw_info_tinted differ diff --git a/test/scr/draw_nothing b/test/scr/draw_nothing index 5903c34..9da5a5a 100644 Binary files a/test/scr/draw_nothing and b/test/scr/draw_nothing differ diff --git a/test/scr/feh_full_lwi b/test/scr/feh_full_lwi index e46cb05..dc551d9 100644 Binary files a/test/scr/feh_full_lwi and b/test/scr/feh_full_lwi differ diff --git a/test/scr/feh_lhi b/test/scr/feh_lhi index f16d150..081c2d8 100644 Binary files a/test/scr/feh_lhi and b/test/scr/feh_lhi differ diff --git a/test/scr/feh_lhi_i b/test/scr/feh_lhi_i index 108dfb6..6db5ea6 100644 Binary files a/test/scr/feh_lhi_i and b/test/scr/feh_lhi_i differ diff --git a/test/scr/feh_lhi_ii b/test/scr/feh_lhi_ii index 1fb695f..1f30f40 100644 Binary files a/test/scr/feh_lhi_ii and b/test/scr/feh_lhi_ii differ diff --git a/test/scr/feh_lhi_iir b/test/scr/feh_lhi_iir index 81748a3..26b2d5c 100644 Binary files a/test/scr/feh_lhi_iir and b/test/scr/feh_lhi_iir differ diff --git a/test/scr/feh_lhi_iirr b/test/scr/feh_lhi_iirr index 7a8079b..ae4d698 100644 Binary files a/test/scr/feh_lhi_iirr and b/test/scr/feh_lhi_iirr differ diff --git a/test/scr/feh_lhi_iirri b/test/scr/feh_lhi_iirri index 31af36f..90c3ed2 100644 Binary files a/test/scr/feh_lhi_iirri and b/test/scr/feh_lhi_iirri differ diff --git a/test/scr/feh_lhi_iirrio b/test/scr/feh_lhi_iirrio index 3a5bdec..3885d05 100644 Binary files a/test/scr/feh_lhi_iirrio and b/test/scr/feh_lhi_iirrio differ diff --git a/test/scr/feh_lhi_o b/test/scr/feh_lhi_o index 72e79a0..627caeb 100644 Binary files a/test/scr/feh_lhi_o and b/test/scr/feh_lhi_o differ diff --git a/test/scr/feh_lhi_oo b/test/scr/feh_lhi_oo index c1806ff..be852ba 100644 Binary files a/test/scr/feh_lhi_oo and b/test/scr/feh_lhi_oo differ diff --git a/test/scr/feh_lhi_ooo b/test/scr/feh_lhi_ooo index 1a6fbf1..71eccc7 100644 Binary files a/test/scr/feh_lhi_ooo and b/test/scr/feh_lhi_ooo differ diff --git a/test/scr/feh_lwi b/test/scr/feh_lwi index 16855f7..21f4f54 100644 Binary files a/test/scr/feh_lwi and b/test/scr/feh_lwi differ diff --git a/test/scr/feh_lwi_scroll_r b/test/scr/feh_lwi_scroll_r index 455a2c2..879ba31 100644 Binary files a/test/scr/feh_lwi_scroll_r and b/test/scr/feh_lwi_scroll_r differ diff --git a/test/scr/feh_lwi_scroll_rd b/test/scr/feh_lwi_scroll_rd index 4ed9fec..f0c591d 100644 Binary files a/test/scr/feh_lwi_scroll_rd and b/test/scr/feh_lwi_scroll_rd differ diff --git a/test/scr/feh_lwi_scroll_rdr b/test/scr/feh_lwi_scroll_rdr index b33270c..1c147ac 100644 Binary files a/test/scr/feh_lwi_scroll_rdr and b/test/scr/feh_lwi_scroll_rdr differ diff --git a/test/scr/feh_lwi_scroll_rdru b/test/scr/feh_lwi_scroll_rdru index c854160..87b50dd 100644 Binary files a/test/scr/feh_lwi_scroll_rdru and b/test/scr/feh_lwi_scroll_rdru differ diff --git a/test/scr/feh_lwi_scroll_rdrul b/test/scr/feh_lwi_scroll_rdrul index 455a2c2..879ba31 100644 Binary files a/test/scr/feh_lwi_scroll_rdrul and b/test/scr/feh_lwi_scroll_rdrul differ diff --git a/test/scr/feh_scaledown_lwi b/test/scr/feh_scaledown_lwi index a842471..0889d54 100644 Binary files a/test/scr/feh_scaledown_lwi and b/test/scr/feh_scaledown_lwi differ diff --git a/test/scr/geometry_offset_only b/test/scr/geometry_offset_only index 1f23f60..77bbae8 100644 Binary files a/test/scr/geometry_offset_only and b/test/scr/geometry_offset_only differ diff --git a/test/scr/index_full_h400 b/test/scr/index_full_h400 index b351eb7..25cae98 100644 Binary files a/test/scr/index_full_h400 and b/test/scr/index_full_h400 differ diff --git a/test/scr/index_full_w400 b/test/scr/index_full_w400 index 6e54f0f..25c09f2 100644 Binary files a/test/scr/index_full_w400 and b/test/scr/index_full_w400 differ diff --git a/test/scr/index_h400 b/test/scr/index_h400 index a3048bc..52f5c3b 100644 Binary files a/test/scr/index_h400 and b/test/scr/index_h400 differ diff --git a/test/scr/index_w400 b/test/scr/index_w400 index e9c637c..9b5ff6a 100644 Binary files a/test/scr/index_w400 and b/test/scr/index_w400 differ diff --git a/test/scr/thumbnail_default b/test/scr/thumbnail_default index e9c637c..9b5ff6a 100644 Binary files a/test/scr/thumbnail_default and b/test/scr/thumbnail_default differ -- cgit v1.2.3 From 3db2920802b6ab4d3a652124339baee007529431 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 19 Dec 2012 08:26:42 +0100 Subject: treat quick, low-offset drags as clicks (closes #113) --- ChangeLog | 3 +++ man/feh.pre | 14 +++++++++----- src/events.c | 14 ++++++++++++-- src/winwidget.h | 1 + 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 524fdd1..c2075b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ git HEAD * Fix delete not working on last image with --cycle-once + * Treat quick, low-offset drags (1px or 2px move in <1 second) as clicks + to improve graphics tablet support + Tue, 16 Oct 2012 06:29:58 +0200 Daniel Friesel diff --git a/man/feh.pre b/man/feh.pre index 81a5cd6..8d41581 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -1363,14 +1363,18 @@ Rotate current image . .Sh MOUSE ACTIONS . -When viewing an image, by default mouse button 1 pans -.Pq moves the image around +Default Bindings: +When viewing an image, mouse button 1 pans the image +.Pq moves it around or, when only clicked, moves to the next image -.Pq slideshow mode only ; -button 2 zooms +.Pq slideshow mode only . +Quick drags with less than 2px of movement per axis will be treated as clicks +to aid grahics tablet users. +. +Mouse button 2 zooms .Po click and drag left->right to zoom in, right->left to zoom out, click once to restore zoom to 100% -.Pc ; +.Pc and mouse button 3 opens the menu. . .Pp diff --git a/src/events.c b/src/events.c index 0d5e07d..dcd1aa1 100644 --- a/src/events.c +++ b/src/events.c @@ -32,6 +32,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "events.h" #include "thumbnail.h" +#define FEH_JITTER_OFFSET 2 +#define FEH_JITTER_TIME 1 + fehbb buttons; feh_event_handler *ev_handler[LASTEvent]; @@ -226,6 +229,7 @@ static void feh_event_handle_ButtonPress(XEvent * ev) D(("click offset is %d,%d\n", ev->xbutton.x, ev->xbutton.y)); winwid->click_offset_x = ev->xbutton.x - winwid->im_x; winwid->click_offset_y = ev->xbutton.y - winwid->im_y; + winwid->click_start_time = time(NULL); } else if (feh_is_bb(&buttons.zoom, button, state)) { D(("Zoom Button Press event\n")); @@ -496,8 +500,14 @@ static void feh_event_handle_MotionNotify(XEvent * ev) winwid = winwidget_get_from_window(ev->xmotion.window); if (winwid) { if (opt.mode == MODE_NEXT) { - opt.mode = MODE_PAN; - winwid->mode = MODE_PAN; + if ((abs(winwid->click_offset_x - (ev->xmotion.x - winwid->im_x)) > FEH_JITTER_OFFSET) + || (abs(winwid->click_offset_y - (ev->xmotion.y - winwid->im_y)) > FEH_JITTER_OFFSET) + || (time(NULL) - winwid->click_start_time > FEH_JITTER_TIME)) { + opt.mode = MODE_PAN; + winwid->mode = MODE_PAN; + } + else + return; } D(("Panning\n")); orig_x = winwid->im_x; diff --git a/src/winwidget.h b/src/winwidget.h index 33ad945..be5a761 100644 --- a/src/winwidget.h +++ b/src/winwidget.h @@ -113,6 +113,7 @@ struct __winwidget { int click_offset_y; int im_click_offset_x; int im_click_offset_y; + time_t click_start_time; unsigned char has_rotated; }; -- cgit v1.2.3 From da09e217570b4c1634a04d73f9d2f871afa2004a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 19 Dec 2012 09:53:50 +0100 Subject: feh(1): fix typo --- man/feh.pre | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/feh.pre b/man/feh.pre index 8d41581..e9ee3b7 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -1369,7 +1369,7 @@ When viewing an image, mouse button 1 pans the image or, when only clicked, moves to the next image .Pq slideshow mode only . Quick drags with less than 2px of movement per axis will be treated as clicks -to aid grahics tablet users. +to aid graphics tablet users. . Mouse button 2 zooms .Po click and drag left->right to zoom in, right->left to zoom out, click once -- cgit v1.2.3