diff --git a/src/ClipboardFile.cpp b/src/ClipboardFile.cpp index 45461ba..1a48cec 100644 --- a/src/ClipboardFile.cpp +++ b/src/ClipboardFile.cpp @@ -43,6 +43,7 @@ namespace gsr { XEvent xev; while(running) { + poll_fds[0].revents = 0; poll(poll_fds, 1, 100); while(XPending(dpy)) { XNextEvent(dpy, &xev); diff --git a/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp b/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp index 4ac02f2..776b85d 100644 --- a/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp +++ b/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp @@ -213,8 +213,10 @@ namespace gsr { continue; } - if(!(poll_fd[i].revents & POLLIN)) + if(!(poll_fd[i].revents & POLLIN)) { + poll_fd[i].revents = 0; continue; + } if(i == event_index) { goto done; @@ -235,6 +237,8 @@ namespace gsr { } else { process_input_event(poll_fd[i].fd, event); } + + poll_fd[i].revents = 0; } } diff --git a/src/Rpc.cpp b/src/Rpc.cpp index 565dcb9..cced7f5 100644 --- a/src/Rpc.cpp +++ b/src/Rpc.cpp @@ -184,6 +184,8 @@ namespace gsr { --num_polls; --i; } + + polls[i].revents = 0; } } } diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c index 81f415c..bfa7c81 100644 --- a/tools/gsr-global-hotkeys/keyboard_event.c +++ b/tools/gsr-global-hotkeys/keyboard_event.c @@ -968,8 +968,10 @@ void keyboard_event_poll_events(keyboard_event *self, int timeout_milliseconds) continue; } - if(!(self->event_polls[i].revents & POLLIN)) + if(!(self->event_polls[i].revents & POLLIN)) { + self->event_polls[i].revents = 0; continue; + } if(i == self->hotplug_event_index) { /* Device is added to end of |event_polls| so it's ok to add while iterating it via index */ @@ -988,6 +990,8 @@ void keyboard_event_poll_events(keyboard_event *self, int timeout_milliseconds) } else { keyboard_event_process_input_event_data(self, &self->event_extra_data[i], self->event_polls[i].fd); } + + self->event_polls[i].revents = 0; } }