summaryrefslogtreecommitdiffstats
path: root/libvo/x11_common.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-07-23 03:30:44 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-07-23 03:38:40 +0300
commit7a669a64073839a0d014f20a691014e332faaf69 (patch)
tree902d9faa1381aaeb992ace2a75b8d4626328212a /libvo/x11_common.c
parent8362ad36ac2ee8dc452765a9de559b50927d14be (diff)
downloadmpv-7a669a64073839a0d014f20a691014e332faaf69.tar.bz2
mpv-7a669a64073839a0d014f20a691014e332faaf69.tar.xz
vo: improve fixed-vo behavior when video size changes in x11 VOs
Now the window is only resized when video size (or size specified by -geometry) changes; reconfiguring the window with the same size no longer changes back to default size from possibly user-modified one. Also fix a bug in fullscreen handling that could cause incorrect window size when turning fullscreen off.
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r--libvo/x11_common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 5f433f478e..9fcd4f3f05 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -757,6 +757,9 @@ void vo_x11_uninit(struct vo *vo)
}
vo_fs = 0;
x11->vo_old_width = x11->vo_old_height = 0;
+ x11->last_video_width = 0;
+ x11->last_video_height = 0;
+ x11->size_changed_during_fs = false;
}
}
@@ -882,6 +885,13 @@ static void vo_x11_nofs_sizepos(struct vo *vo, int x, int y,
int width, int height)
{
struct vo_x11_state *x11 = vo->x11;
+ if (width == x11->last_video_width && height == x11->last_video_height) {
+ if (!vo->opts->force_window_position && !x11->size_changed_during_fs)
+ return;
+ } else if (vo_fs)
+ x11->size_changed_during_fs = true;
+ x11->last_video_height = height;
+ x11->last_video_width = width;
vo_x11_sizehint(vo, x, y, width, height, 0);
if (vo_fs) {
x11->vo_old_x = x;
@@ -1321,6 +1331,10 @@ void vo_x11_fullscreen(struct vo *vo)
{
vo_x11_ewmh_fullscreen(x11, _NET_WM_STATE_REMOVE); // removes fullscreen state if wm supports EWMH
vo_fs = VO_FALSE;
+ if (x11->size_changed_during_fs && (x11->fs_type & vo_wm_FULLSCREEN))
+ vo_x11_nofs_sizepos(vo, vo->dx, vo->dy, x11->last_video_width,
+ x11->last_video_height);
+ x11->size_changed_during_fs = false;
} else
{
// win->fs