Lines 34-39
Link Here
|
34 |
#endif |
34 |
#endif |
35 |
#endif |
35 |
#endif |
36 |
|
36 |
|
|
|
37 |
#ifdef linux |
38 |
#include <sys/fcntl.h> |
39 |
#endif |
40 |
|
37 |
#include "parse.h" |
41 |
#include "parse.h" |
38 |
#include "str_util.h" |
42 |
#include "str_util.h" |
39 |
#include "util.h" |
43 |
#include "util.h" |
Lines 125-130
Link Here
|
125 |
launched_by_manager = false; |
129 |
launched_by_manager = false; |
126 |
initialized = false; |
130 |
initialized = false; |
127 |
last_wakeup_time = dtime(); |
131 |
last_wakeup_time = dtime(); |
|
|
132 |
#ifdef linux |
133 |
mouse_moved = true; |
134 |
mouse_event_t = time(NULL); |
135 |
mouse_fd = open("/dev/input/mouse0", O_RDONLY); |
136 |
#endif |
137 |
} |
138 |
|
139 |
CLIENT_STATE::~CLIENT_STATE() |
140 |
{ |
141 |
#ifdef linux |
142 |
if(mouse_fd != -1) |
143 |
close(mouse_fd); |
144 |
#endif |
128 |
} |
145 |
} |
129 |
|
146 |
|
130 |
void CLIENT_STATE::show_host_info() { |
147 |
void CLIENT_STATE::show_host_info() { |
Lines 414-419
Link Here
|
414 |
http_ops->get_fdset(curl_fds); |
431 |
http_ops->get_fdset(curl_fds); |
415 |
all_fds = curl_fds; |
432 |
all_fds = curl_fds; |
416 |
gui_rpcs.get_fdset(gui_rpc_fds, all_fds); |
433 |
gui_rpcs.get_fdset(gui_rpc_fds, all_fds); |
|
|
434 |
#ifdef linux |
435 |
FD_SET(mouse_fd, &all_fds.read_fds); |
436 |
if (mouse_fd > all_fds.max_fd) all_fds.max_fd = mouse_fd; |
437 |
#endif |
417 |
double_to_timeval(x, tv); |
438 |
double_to_timeval(x, tv); |
418 |
n = select( |
439 |
n = select( |
419 |
all_fds.max_fd+1, |
440 |
all_fds.max_fd+1, |
Lines 429-434
Link Here
|
429 |
|
451 |
|
430 |
http_ops->got_select(all_fds, x); |
452 |
http_ops->got_select(all_fds, x); |
431 |
gui_rpcs.got_select(all_fds); |
453 |
gui_rpcs.got_select(all_fds); |
|
|
454 |
#ifdef linux |
455 |
if (mouse_fd != -1) { |
456 |
if (FD_ISSET(mouse_fd, &all_fds.read_fds)) { |
457 |
char ps2_packet[3]; //assume ps/2 mouse protocol 3 byte packet |
458 |
if(read(mouse_fd, ps2_packet, 3) == 3) { |
459 |
mouse_moved = true; |
460 |
mouse_event_t = time(NULL); |
461 |
} |
462 |
} |
463 |
} |
464 |
#endif |
432 |
|
465 |
|
433 |
if (n==0) break; |
466 |
if (n==0) break; |
434 |
|
467 |
|
Lines 496-501
Link Here
|
496 |
#ifdef __APPLE__ |
529 |
#ifdef __APPLE__ |
497 |
, &idletime |
530 |
, &idletime |
498 |
#endif |
531 |
#endif |
|
|
532 |
#ifdef linux |
533 |
, &mouse_moved |
534 |
, mouse_event_t |
535 |
#endif |
499 |
); |
536 |
); |
500 |
|
537 |
|
501 |
if (user_active != old_user_active) { |
538 |
if (user_active != old_user_active) { |