1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-02 21:12:23 +00:00

w32_common: support the "window-minimized" property

This commit is contained in:
James Ross-Gowan 2015-03-09 20:30:33 +11:00 committed by wm4
parent 3efbc1a9a3
commit a26ea50694
2 changed files with 6 additions and 2 deletions

View File

@ -2,8 +2,6 @@
-- if it's brought back again. If the player was already paused when minimizing, -- if it's brought back again. If the player was already paused when minimizing,
-- then try not to mess with the pause state. -- then try not to mess with the pause state.
-- Note: currently works with X11 or OS X only.
local did_minimize = false local did_minimize = false
mp.observe_property("window-minimized", "bool", function(name, value) mp.observe_property("window-minimized", "bool", function(name, value)

View File

@ -603,6 +603,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
signal_events(w32, VO_EVENT_RESIZE); signal_events(w32, VO_EVENT_RESIZE);
MP_VERBOSE(w32, "resize window: %d:%d\n", w32->dw, w32->dh); 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; break;
} }
case WM_SIZING: 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); reinit_window_state(w32);
return VO_TRUE; 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: case VOCTRL_SET_CURSOR_VISIBILITY:
w32->cursor_visible = *(bool *)arg; w32->cursor_visible = *(bool *)arg;