# HG changeset patch # User reimar # Date 1274291627 0 # Node ID ff79dd5474f869a98cc34190e5b36f662b3694e8 # Parent b11e3ae960ac3fe44460d12670f9d6edcc8631e1 Handle -wid Window being closed for direct3d and gl vos on Windows. diff -r b11e3ae960ac -r ff79dd5474f8 libvo/w32_common.c --- a/libvo/w32_common.c Wed May 19 13:31:11 2010 +0000 +++ b/libvo/w32_common.c Wed May 19 17:53:47 2010 +0000 @@ -200,15 +200,19 @@ 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;