Client: map keyboard mapping privately

We are never going to write back changes into the compositor's keymap,
so there is no reason to have support for writing back to the
compositor.

V7 of the spec says:
"From version 7 onwards, the fd must be mapped with MAP_PRIVATE by the
recipient, as MAP_SHARED may fail."

Whilst we don't support v7 yet it is harmless to change this early.

Task-number: QTBUG-96259
Change-Id: I16afcae4aa89ff24955981e714096359d0a54792
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
David Edmundson 2021-09-07 11:28:19 +01:00
parent 66cbac0b30
commit 60fb809a79

View File

@ -1165,7 +1165,7 @@ void QWaylandInputDevice::Keyboard::keyboard_keymap(uint32_t format, int32_t fd,
return;
}
char *map_str = static_cast<char *>(mmap(nullptr, size, PROT_READ, MAP_SHARED, fd, 0));
char *map_str = static_cast<char *>(mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0));
if (map_str == MAP_FAILED) {
close(fd);
return;