rewind the keymap file before

passing it to clients
This commit is contained in:
Christian Meissl 2021-12-03 20:04:52 +01:00 committed by Victor Berger
parent 1088e62a6f
commit 6b1788d002
2 changed files with 3 additions and 1 deletions

View File

@ -61,6 +61,7 @@
- `Multicache::has()` now correctly does what is expected of it - `Multicache::has()` now correctly does what is expected of it
- `xdg_shell` had an issue where it was possible that configured state gets overwritten before it was acked/committed. - `xdg_shell` had an issue where it was possible that configured state gets overwritten before it was acked/committed.
- `wl_keyboard` rewind the `keymap` file before passing it to the client
#### Backends #### Backends

View File

@ -5,7 +5,7 @@ use std::{
cell::RefCell, cell::RefCell,
default::Default, default::Default,
fmt, fmt,
io::{Error as IoError, Write}, io::{Error as IoError, Seek, Write},
ops::Deref as _, ops::Deref as _,
os::unix::io::AsRawFd, os::unix::io::AsRawFd,
rc::Rc, rc::Rc,
@ -481,6 +481,7 @@ impl KeyboardHandle {
let ret = tempfile().and_then(|mut f| { let ret = tempfile().and_then(|mut f| {
f.write_all(self.arc.keymap.as_bytes())?; f.write_all(self.arc.keymap.as_bytes())?;
f.flush()?; f.flush()?;
f.rewind()?;
kbd.keymap( kbd.keymap(
KeymapFormat::XkbV1, KeymapFormat::XkbV1,
f.as_raw_fd(), f.as_raw_fd(),