From a26ea5069412c74e7d68599c6299331bfcd64030 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Mon, 9 Mar 2015 20:30:33 +1100 Subject: w32_common: support the "window-minimized" property --- TOOLS/lua/pause-when-minimize.lua | 2 -- video/out/w32_common.c | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/TOOLS/lua/pause-when-minimize.lua b/TOOLS/lua/pause-when-minimize.lua index 69cb382b19..99add709f1 100644 --- a/TOOLS/lua/pause-when-minimize.lua +++ b/TOOLS/lua/pause-when-minimize.lua @@ -2,8 +2,6 @@ -- if it's brought back again. If the player was already paused when minimizing, -- then try not to mess with the pause state. --- Note: currently works with X11 or OS X only. - local did_minimize = false mp.observe_property("window-minimized", "bool", function(name, value) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 12c37b5f0d..40fef70bc0 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -603,6 +603,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, signal_events(w32, VO_EVENT_RESIZE); MP_VERBOSE(w32, "resize window: %d:%d\n", w32->dw, w32->dh); } + + // Window may have been minimized or restored + signal_events(w32, VO_EVENT_WIN_STATE); break; } case WM_SIZING: @@ -1256,6 +1259,9 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg) reinit_window_state(w32); return VO_TRUE; } + case VOCTRL_GET_WIN_STATE: + *(int *)arg = IsIconic(w32->window) ? VO_WIN_STATE_MINIMIZED : 0; + return VO_TRUE; case VOCTRL_SET_CURSOR_VISIBILITY: w32->cursor_visible = *(bool *)arg; -- cgit v1.2.3