void-packages/srcpkgs/mouseemu/patches/014-time64.patch

40 lines
1.3 KiB
Diff

--- a/mouseemu.c 2021-01-11 16:44:11.242213686 +0100
+++ b/mouseemu.c 2021-01-11 16:45:42.351171654 +0100
@@ -80,6 +80,7 @@
static void send_event(int fd, int type, int code, int value)
{
struct input_event event;
+ struct timeval tv;
if (fd < 0)
return;
@@ -87,7 +88,9 @@
event.type = type;
event.code = code;
event.value = value;
- gettimeofday(&event.time, NULL);
+ gettimeofday(&tv, NULL);
+ event.input_event_sec = tv.tv_sec;
+ event.input_event_usec = tv.tv_usec;
if (write(fd, &event, sizeof(event)) < sizeof(event))
perror("send_event");
@@ -197,7 +200,7 @@
return;
if (!event_parse(inp.code, inp.value) && !is_modifier(inp)) {
- last_key = (inp.time.tv_sec*1000000 + inp.time.tv_usec);
+ last_key = (inp.input_event_sec*1000000 + inp.input_event_usec);
}
/* I think its best not to pass scroll, or experiment with not passing the release if
* we actually used it for scrolling (but some apps may get stuck?)
@@ -228,7 +231,7 @@
report_scroll (inp.value);
//printf("inp.value %d\n", inp.value);
} else {
- if ((inp.time.tv_sec*1000000+inp.time.tv_usec)-last_key > typing_block_delay*1000
+ if ((inp.input_event_sec*1000000+inp.input_event_usec)-last_key > typing_block_delay*1000
|| inp.type == EV_REL)
passthrough(ui_mouse_fd, inp);
}