Clear mouse input ntf fd on each event loop

This commit is contained in:
pelya
2020-07-22 18:54:17 +03:00
parent a4e6f11993
commit 6c79cef932
2 changed files with 6 additions and 3 deletions

View File

@@ -85,9 +85,12 @@ void sdlPollInput(void)
SDL_Event event; SDL_Event event;
//printf("sdlPollInput() %d thread %d fd %d\n", SDL_GetTicks(), (int) pthread_self(), sdlInputNotifyFd[0]); //printf("sdlPollInput() %d thread %d fd %d\n", SDL_GetTicks(), (int) pthread_self(), sdlInputNotifyFd[0]);
while (read(sdlInputNotifyFd[0], &buf, 1) == 1) { }
while ( SDL_PollEvent(&event) ) { while ( SDL_PollEvent(&event) )
switch (event.type) { {
switch (event.type)
{
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
//printf("SDL_MOUSEMOTION x:y %d:%d buttons %d\n", event.motion.x, event.motion.y, mouseState); //printf("SDL_MOUSEMOTION x:y %d:%d buttons %d\n", event.motion.x, event.motion.y, mouseState);
KdEnqueuePointerEvent(sdlPointer, mouseState, event.motion.x, event.motion.y, pressure); KdEnqueuePointerEvent(sdlPointer, mouseState, event.motion.x, event.motion.y, pressure);

View File

@@ -4,4 +4,4 @@
adb forward tcp:6001 tcp:6000 adb forward tcp:6001 tcp:6000
env DISPLAY=127.0.0.1:1 sh -c "x-window-manager & xlogo & xev" env DISPLAY=127.0.0.1:1 sh -c "xfwm4 & xlogo & xev"