diff options
author | maniak1349 <maniak1349@gmail.com> | 2016-04-26 04:47:14 +0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-04-30 18:55:09 +0200 |
commit | 949247d6e63d3742fef7211bd3a43fa9b1f1d490 (patch) | |
tree | 89946a3e91125b787686576b5759a626dced7618 | |
parent | 70f64f3ca97e333d6a9a874f574710c09f6979b2 (diff) |
w32_common: respect --fit-border on size check
Fit whole window or just a client area in accord with value of --fit-border option.
Fixes #2935.
-rw-r--r-- | video/out/w32_common.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 0398b08fda..042e81b7fe 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1067,15 +1067,31 @@ static void reinit_window_state(struct vo_w32_state *w32) RECT cr = r; add_window_borders(w32->window, &r); + // Check on client area size instead of window size on --fit-border=no + long o_w; + long o_h; + if( w32->opts->fit_border ) { + o_w = r.right - r.left; + o_h = r.bottom - r.top; + } else { + o_w = cr.right - cr.left; + o_h = cr.bottom - cr.top; + } - if (!w32->current_fs && - ((r.right - r.left) > screen_w || (r.bottom - r.top) > screen_h)) + if ( !w32->current_fs && ( o_w > screen_w || o_h > screen_h ) ) { MP_VERBOSE(w32, "requested window size larger than the screen\n"); // Use the aspect of the client area, not the full window size. // Basically, try to compute the maximum window size. - long n_w = screen_w - (r.right - cr.right) - (cr.left - r.left); - long n_h = screen_h - (r.bottom - cr.bottom) - (cr.top - r.top); + long n_w; + long n_h; + if( w32->opts->fit_border ) { + n_w = screen_w - (r.right - cr.right) - (cr.left - r.left); + n_h = screen_h - (r.bottom - cr.bottom) - (cr.top - r.top); + } else { + n_w = screen_w; + n_h = screen_h; + } // Letterbox double asp = (cr.right - cr.left) / (double)(cr.bottom - cr.top); double s_asp = n_w / (double)n_h; |