Skip to content

Commit

Permalink
Patch by Noel Cragg: Make feh actually usable in tiling mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Friesel committed Jul 14, 2010
1 parent faf43f2 commit 4ddc466
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ git HEAD
-K for --caption-papth,
-G for --draw-actions
and -J for --thumb-redraw
* Patch by Noel Cragg: Improve support for tiling window managers

Fri, 25 Jun 2010 16:07:20 +0200 Daniel Friesel <derf@chaosdorf.de>

Expand Down
21 changes: 13 additions & 8 deletions src/winwidget.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ void winwidget_create_window(winwidget ret, int w, int h)
int x = 0;
int y = 0;

D(4, ("winwidget_create_window %dx%d\n", w, h));

if (ret->full_screen) {
w = scr->width;
h = scr->height;
Expand Down Expand Up @@ -342,22 +344,25 @@ void winwidget_render_image(winwidget winwid, int resize, int alias)
if (winwid->im_y > winwid->h)
winwid->im_y = winwid->h;

winwidget_setup_pixmaps(winwid);
D(2, ("winwidget_render_image resize %d alias %d im %dx%d\n",
resize, alias, winwid->im_w, winwid->im_h));

if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im)) || (opt.geom_flags)
|| (winwid->im_x || winwid->im_y) || (winwid->zoom != 1.0)
|| (winwid->w > winwid->im_w || winwid->h > winwid->im_h)
|| (winwid->has_rotated)))
feh_draw_checks(winwid);
winwidget_setup_pixmaps(winwid);

if (!winwid->full_screen && opt.scale_down && ((winwid->w < winwid->im_w)
|| (winwid->h < winwid->im_h))) {
D(2, ("scaling down image\n"));
D(2, ("scaling down image %dx%d\n", winwid->w, winwid->h));

feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, winwid->w, winwid->h);
winwidget_resize(winwid, winwid->im_w * winwid->zoom, winwid->im_h * winwid->zoom);
D(2, ("after scaling down image %dx%d\n", winwid->w, winwid->h));
}

if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im)) || (opt.geom_flags)
|| (winwid->im_x || winwid->im_y) || (winwid->zoom != 1.0)
|| (winwid->w > winwid->im_w || winwid->h > winwid->im_h)
|| (winwid->has_rotated)))
feh_draw_checks(winwid);

if (resize && (winwid->full_screen || opt.geom_flags)) {
int smaller; /* Is the image smaller than screen? */
int max_w = 0, max_h = 0;
Expand Down

0 comments on commit 4ddc466

Please sign in to comment.