mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-21 23:50:45 +01:00
evdev-fallback: Use input_event_init for fallback
Old-style field initialisation ignores the 64-bit time_t change in
Linux UAPI, which causes the structure to be incompletely initialised
on 32-bit systems with the 64-bit time_t kernel headers.
This patch uses the input_event_init helper from the original 64-bit
time_t enablement patch.
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Fixes: 5dc1a7ebd ("Adjust for 64bit time_t for 32bit architectures")
See-Also: libinput/libinput!346
This commit is contained in:
parent
2fe672ecee
commit
ab377baa12
1 changed files with 5 additions and 4 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include <mtdev-plumbing.h>
|
||||
|
||||
#include "evdev-fallback.h"
|
||||
#include "util-input-event.h"
|
||||
|
||||
static void
|
||||
fallback_keyboard_notify_key(struct fallback_dispatch *dispatch,
|
||||
|
|
@ -701,10 +702,10 @@ fallback_lid_keyboard_event(uint64_t time,
|
|||
if (dispatch->lid.reliability == RELIABILITY_WRITE_OPEN) {
|
||||
int fd = libevdev_get_fd(dispatch->device->evdev);
|
||||
int rc;
|
||||
struct input_event ev[2] = {
|
||||
{{ 0, 0 }, EV_SW, SW_LID, 0 },
|
||||
{{ 0, 0 }, EV_SYN, SYN_REPORT, 0 },
|
||||
};
|
||||
struct input_event ev[2];
|
||||
|
||||
ev[0] = input_event_init(0, EV_SW, SW_LID, 0);
|
||||
ev[1] = input_event_init(0, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
rc = write(fd, ev, sizeof(ev));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue