diff options
author | Julian Orth <ju.orth@gmail.com> | 2022-01-07 23:26:18 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-01-08 15:20:02 +0000 |
commit | 3978669ece8bf2f5cb7318782607840195244368 (patch) | |
tree | 77cc310134a2942b90d46613f76a51a26203b962 /video/out | |
parent | d09c73c7b2b0135cb24ab2173b3c4ee1c55840b0 (diff) | |
download | mpv-3978669ece8bf2f5cb7318782607840195244368.tar.bz2 mpv-3978669ece8bf2f5cb7318782607840195244368.tar.xz |
wayland: map keymaps with `MAP_PRIVATE`
While mpv uses version 1 of the `wl_seat` protocol and `MAP_PRIVATE` is
only required from version 7 on, using `MAP_PRIVATE` allows us to be
compatible with compositors that have only been tested with newer
applications.
Since the keymap is not modified after `mmap`, using `MAP_SHARED` has no
advantage over `MAP_PRIVATE`.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/wayland_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 8f9b1e9b55..226c94f7bc 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -344,7 +344,7 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *wl_keyboard, return; } - map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); + map_str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); if (map_str == MAP_FAILED) { close(fd); return; |