summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-19 21:58:55 +0200
committerwm4 <wm4@nowhere>2014-05-19 21:59:10 +0200
commit5f6406f450279532c34229df05f6a9fc6c82d4df (patch)
treebdbf03a98d5507f3114937317341570ecb4ea684 /video
parentebe798cbc004e704cf4070230204b358160aeaf0 (diff)
downloadmpv-5f6406f450279532c34229df05f6a9fc6c82d4df.tar.bz2
mpv-5f6406f450279532c34229df05f6a9fc6c82d4df.tar.xz
x11: leaving fullscreen -> reset WM hints only if needed
This works around an issue in OpenBox: OpenBox apparently sizes the normal window incorrectly if aspect ratio hints are set, and the window size is off by 1 pixel. Then, when going fullscreen and leaving fullscreen again, mpv sets the hints based on OpenBox' broken window size, and as result, OpenBox sizes the window incorrectly and is off by 1 pixel again - so it's 2 pixels off in total. The error gets more visible, the more often you toggle fullscreen mode. Work this around by not setting the window hints if we don't need to. Actually we only need to do this when the video is resized during fullscreen, which happens rarely. Under normal circumstances, leaving fullscreen mode requires that the WM restores the old state. As such, this commit is not only a workaround, but actually a cleanup. Note that we do need to set the hints when leaving fullscreen if the window has resized: even though we set the hints in vo_x11_highlevel_resize (called by vo_x11_config_vo_window), this doesn't seem to have an effect (at least on IceWM), so we have to do it after that. Side note: ot seems commit 625ad57a strangely triggered the OpenBox issue according to user reports; I'm not sure why.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 9c0d271bf2..7d96588fb4 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1438,10 +1438,12 @@ static void vo_x11_fullscreen(struct vo *vo)
vo_x11_ewmh_fullscreen(x11, _NET_WM_STATE_ADD);
} else {
vo_x11_ewmh_fullscreen(x11, _NET_WM_STATE_REMOVE);
- vo_x11_move_resize(vo,
- x11->pos_changed_during_fs,
- x11->size_changed_during_fs,
- x11->nofsrc);
+ if (x11->pos_changed_during_fs || x11->size_changed_during_fs) {
+ vo_x11_move_resize(vo,
+ x11->pos_changed_during_fs,
+ x11->size_changed_during_fs,
+ x11->nofsrc);
+ }
}
} else {
struct mp_rect rc = x11->nofsrc;