summaryrefslogtreecommitdiff
path: root/user/open-vm-tools/time64.patch
blob: bc6bbb091448559a550116f9884dba28bdfd1ad5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff --git a/open-vm-tools/services/plugins/dndcp/fakeMouseWayland/fakeMouseWayland.cpp b/open-vm-tools/services/plugins/dndcp/fakeMouseWayland/fakeMouseWayland.cpp
index 0311a4e7..4a231a4d 100644
--- a/services/plugins/dndcp/fakeMouseWayland/fakeMouseWayland.cpp
+++ b/services/plugins/dndcp/fakeMouseWayland/fakeMouseWayland.cpp
@@ -249,11 +249,14 @@ FakeMouse_Move(int x,    // IN
 
    bool retValue = true;
    struct input_event event;
+   struct timeval tv;
 
    event.type = EV_ABS;
    event.code = ABS_X;
    event.value = x;
-   gettimeofday(&event.time, NULL);
+   gettimeofday(&tv, NULL);
+   event.input_event_sec = tv.tv_sec;
+   event.input_event_usec = tv.tv_usec;
    if (write(uinput_fd, &event, sizeof(event)) < 0) {
       g_debug("Line:%d. Function:%s. Failed to write\n", __LINE__, __FUNCTION__);
       retValue = false;
@@ -262,7 +265,9 @@ FakeMouse_Move(int x,    // IN
    event.type = EV_ABS;
    event.code = ABS_Y;
    event.value = y;
-   gettimeofday(&event.time, NULL);
+   gettimeofday(&tv, NULL);
+   event.input_event_sec = tv.tv_sec;
+   event.input_event_usec = tv.tv_usec;
    if (write(uinput_fd, &event, sizeof(event)) < 0) {
       g_debug("Line:%d. Function:%s. Failed to write\n", __LINE__, __FUNCTION__);
       retValue = false;
@@ -271,7 +276,9 @@ FakeMouse_Move(int x,    // IN
    event.type = EV_SYN;
    event.code = SYN_REPORT;
    event.value = 0;
-   gettimeofday(&event.time, NULL);
+   gettimeofday(&tv, NULL);
+   event.input_event_sec = tv.tv_sec;
+   event.input_event_usec = tv.tv_usec;
    if (write(uinput_fd, &event, sizeof(event)) < 0) {
       g_debug("Line:%d. Function:%s. Failed to write\n", __LINE__, __FUNCTION__);
       retValue = false;
@@ -306,11 +313,14 @@ FakeMouse_Click(bool down)  // IN
 
    bool retValue = true;
    struct input_event event;
+   struct timeval tv;
 
    event.type = EV_KEY;
    event.code = BTN_LEFT;
    event.value = down;
-   gettimeofday(&event.time, NULL);
+   gettimeofday(&tv, NULL);
+   event.input_event_sec = tv.tv_sec;
+   event.input_event_usec = tv.tv_usec;
    if (write(uinput_fd, &event, sizeof(event)) < 0) {
       g_debug("Line:%d. Function:%s. Failed to write\n", __LINE__, __FUNCTION__);
       retValue = false;