summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-19 17:53:47 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-19 17:53:47 +0000
commitf62044777bbdf946eff6aae54616bbddd998816d (patch)
treeb54fb155f3399e9c69a79717f4c9de9b05ce6e10 /libvo
parentf53f31894c2ed2e923e9c9eeecf3edd9d2c05ae2 (diff)
downloadmpv-f62044777bbdf946eff6aae54616bbddd998816d.tar.bz2
mpv-f62044777bbdf946eff6aae54616bbddd998816d.tar.xz
Handle -wid Window being closed for direct3d and gl vos on Windows.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31182 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/w32_common.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index bb420d87c9..6d05d4ed76 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -200,15 +200,19 @@ int vo_w32_check_events(void) {
DispatchMessage(&msg);
}
if (WinID >= 0) {
+ BOOL res;
RECT r;
- GetClientRect(vo_window, &r);
- if (r.right != vo_dwidth || r.bottom != vo_dheight) {
+ res = GetClientRect(vo_window, &r);
+ if (res && (r.right != vo_dwidth || r.bottom != vo_dheight)) {
vo_dwidth = r.right; vo_dheight = r.bottom;
event_flags |= VO_EVENT_RESIZE;
}
- GetClientRect(WinID, &r);
- if (r.right != vo_dwidth || r.bottom != vo_dheight)
+ res = GetClientRect(WinID, &r);
+ if (res && (r.right != vo_dwidth || r.bottom != vo_dheight))
MoveWindow(vo_window, 0, 0, r.right, r.bottom, FALSE);
+ if (!IsWindow(WinID))
+ // Window has probably been closed, e.g. due to program crash
+ mplayer_put_key(KEY_CLOSE_WIN);
}
return event_flags;