summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossymiles@gmail.com>2015-03-09 20:30:33 +1100
committerwm4 <wm4@nowhere>2015-03-09 11:46:06 +0100
commita26ea5069412c74e7d68599c6299331bfcd64030 (patch)
tree50dbd3d7a2bfd5617e32f551ce4d1617d58b42d5
parent3efbc1a9a38de2f0af4778ab9388c6a8e1c11ca6 (diff)
downloadmpv-a26ea5069412c74e7d68599c6299331bfcd64030.tar.bz2
mpv-a26ea5069412c74e7d68599c6299331bfcd64030.tar.xz
w32_common: support the "window-minimized" property
-rw-r--r--TOOLS/lua/pause-when-minimize.lua2
-rw-r--r--video/out/w32_common.c6
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;