mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
util: use shm_open for in-memory files
shm_open is a POSIX function creating an in-memory file. Using it simplifies the code and removes the dependency on XDG_RUNTIME_DIR. The only downside is that we need to generate a random name for the shm file.
This commit is contained in:
parent
f668e49fae
commit
346ec21c4c
8 changed files with 80 additions and 164 deletions
|
|
@ -12,7 +12,7 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include "types/wlr_seat.h"
|
||||
#include "util/signal.h"
|
||||
#include "util/os-compatibility.h"
|
||||
#include "util/shm.h"
|
||||
|
||||
static void default_keyboard_enter(struct wlr_seat_keyboard_grab *grab,
|
||||
struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
|
||||
|
|
@ -341,7 +341,7 @@ static void seat_client_send_keymap(struct wlr_seat_client *client,
|
|||
continue;
|
||||
}
|
||||
|
||||
int keymap_fd = os_create_anonymous_file(keyboard->keymap_size);
|
||||
int keymap_fd = allocate_shm_file(keyboard->keymap_size);
|
||||
if (keymap_fd < 0) {
|
||||
wlr_log(WLR_ERROR, "creating a keymap file for %zu bytes failed", keyboard->keymap_size);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue