summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-07-17 17:09:33 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-07-17 17:09:33 +0200
commit946c837a9fe78737020ae0d3a7f1b2e7201ae3ff (patch)
treef01c2808566fcbd1539e8dbc58850265b7835c6b
parentfd696d7b12840420cb9364a0b524f67f4379ab92 (diff)
parent98f82337ac9da3faccf63d131818e7a77953ec2c (diff)
Merge branch 'ulteq-fix-screen-clip'
-rw-r--r--src/winwidget.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index e54b49e..fe0b505 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -799,12 +799,16 @@ void winwidget_resize(winwidget winwid, int w, int h, int force_resize)
}
if (winwid && ((winwid->w != w) || (winwid->h != h))) {
if (opt.screen_clip) {
- double required_zoom = 1.0;
- int max_w = (w > scr_width) ? scr_width : w;
- int max_h = (h > scr_height) ? scr_height : h;
- feh_calc_needed_zoom(&required_zoom, winwid->im_w, winwid->im_h, max_w, max_h);
- winwid->w = winwid->im_w * required_zoom;
- winwid->h = winwid->im_h * required_zoom;
+ double required_zoom = winwid->zoom;
+ if (opt.scale_down && !opt.keep_zoom_vp) {
+ int max_w = (w > scr_width) ? scr_width : w;
+ int max_h = (h > scr_height) ? scr_height : h;
+ feh_calc_needed_zoom(&required_zoom, winwid->im_w, winwid->im_h, max_w, max_h);
+ }
+ int desired_w = winwid->im_w * required_zoom;
+ int desired_h = winwid->im_h * required_zoom;
+ winwid->w = (desired_w > scr_width) ? scr_width : desired_w;
+ winwid->h = (desired_h > scr_height) ? scr_height : desired_h;
}
if (winwid->full_screen) {
XTranslateCoordinates(disp, winwid->win, attributes.root,