summaryrefslogtreecommitdiffstats
path: root/video/out/vo_sdl.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /video/out/vo_sdl.c
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r--video/out/vo_sdl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 5f4c027..71791e2 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -547,6 +547,10 @@ static void wait_events(struct vo *vo, int64_t until_time_ns)
case SDL_WINDOWEVENT_LEAVE:
mp_input_put_key(vo->input_ctx, MP_KEY_MOUSE_LEAVE);
break;
+ case SDL_WINDOWEVENT_FOCUS_LOST:
+ case SDL_WINDOWEVENT_FOCUS_GAINED:
+ vo_event(vo, VO_EVENT_FOCUS);
+ break;
}
break;
case SDL_QUIT:
@@ -959,6 +963,9 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_UPDATE_WINDOW_TITLE:
SDL_SetWindowTitle(vc->window, (char *)data);
return true;
+ case VOCTRL_GET_FOCUSED:
+ *(bool *)data = SDL_GetWindowFlags(vc->window) & SDL_WINDOW_INPUT_FOCUS;
+ return VO_TRUE;
}
return VO_NOTIMPL;
}