From 3978669ece8bf2f5cb7318782607840195244368 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 7 Jan 2022 23:26:18 +0100 Subject: 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`. --- video/out/wayland_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3