WindowServer: Fix wrong-sized read() from keyboard

It's unfortunate that WindowServer::KeyEvent and the kernel KeyEvent
have the same name here.

Fixes #1190.
This commit is contained in:
Andreas Kling 2020-02-07 00:01:28 +01:00
parent 6a9cc66b97
commit f24a6a7574

View file

@ -140,7 +140,7 @@ void EventLoop::drain_keyboard()
auto& screen = Screen::the();
for (;;) {
::KeyEvent event;
ssize_t nread = read(m_keyboard_fd, (u8*)&event, sizeof(KeyEvent));
ssize_t nread = read(m_keyboard_fd, (u8*)&event, sizeof(::KeyEvent));
if (nread == 0)
break;
ASSERT(nread == sizeof(::KeyEvent));