1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 09:32:40 +00:00
mpv/player
Guido Cella 9b9ce74afa command: add read-only focused property
Add a property that returns whether the window is focused, currently
only for X11 and Wayland.

My use cause for this is having an equivalent of pause-when-minimize.lua
for tiling window managers: make mpv play only while it's in the current
workspace or is focused (I'm fine with either one but prefer focus).
On X I do this by observing display-names, which is empty when the
rectangles of the display and mpv don't intersect, but on Wayland its
value doesn't change when mpv leaves the current workspace (and the same
check doesn't work since the geometries still intersect).

This could later be made writable as requested in #6252.

Note that on Wayland se shouldn't consider an unactivated window with
keyboard input focused.

The wlroots compositors I tested set activated after changing the
keyboard focus, so if you set wl->focused only in
keyboard_handle_enter() and keyboard_handle_leave() to avoid adding the
"has_keyboard_input" member, focused isn't set to true when first
opening mpv until you focus another window and focus mpv again.

Conversely, if that order can't be assumed for all compositors, we
should toggle wl->focused when necessary in keyboard_handle_enter() and
keyboard_handle_leave() as well as in handle_toplevel_config().
2020-09-08 20:09:17 +02:00
..
javascript js: hooks: allow deferred continuation (match d0ab562b) 2020-08-07 15:12:20 +03:00
lua ytdl_hook: sort subtitle list by language 2020-08-12 20:16:13 +02:00
audio.c encode: remove early EOF failure handling 2020-09-03 12:29:12 +02:00
client.c client API: inactivate the opengl_cb API 2020-09-03 14:52:11 +02:00
client.h scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
command.c command: add read-only focused property 2020-09-08 20:09:17 +02:00
command.h command: add read-only focused property 2020-09-08 20:09:17 +02:00
configfiles.c player: warn if both proper and compat. config directories exist 2020-06-25 17:56:16 +02:00
core.h audio: reduce excessive logging of delayed audio start 2020-09-03 12:18:42 +02:00
external_files.c external_files: add .pgs subtitle extension 2020-07-21 15:07:17 +02:00
external_files.h
javascript.c win32: scripting utils.get_env_list(): use UTF-8 2020-08-16 12:24:19 +03:00
loadfile.c encode: propagate errors to exit status properly 2020-09-03 15:44:35 +02:00
lua.c win32: scripting utils.get_env_list(): use UTF-8 2020-08-16 12:24:19 +03:00
main.c build: change filenames of generated files 2020-06-04 16:59:05 +02:00
misc.c audio: refactor how data is passed to AO 2020-08-29 13:12:32 +02:00
osd.c player: add --term-title option 2020-05-25 20:39:37 +02:00
playloop.c command: add read-only focused property 2020-09-08 20:09:17 +02:00
screenshot.c screenshot: fix typo in comment 2020-02-07 13:42:42 +01:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c auto_profiles: add this script 2020-08-05 22:37:47 +02:00
sub.c command: add property to return text subtitles in ASS 2020-05-14 22:14:49 +02:00
video.c encode: remove early EOF failure handling 2020-09-03 12:29:12 +02:00