diff options
author | 2008-12-17 18:05:43 -0800 | |
---|---|---|
committer | 2008-12-17 18:05:43 -0800 | |
commit | f013e1afd1e68af5e3b868c26a653bbfb39538f8 (patch) | |
tree | 7ad6c8fd9c7b55f4b4017171dec1cb760bbd26bf /libs/ui/EventHub.cpp | |
parent | e70cfafe580c6f2994c4827cd8a534aabf3eb05c (diff) |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'libs/ui/EventHub.cpp')
-rw-r--r-- | libs/ui/EventHub.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp index f0c77ba42b86..abe74077f958 100644 --- a/libs/ui/EventHub.cpp +++ b/libs/ui/EventHub.cpp @@ -315,9 +315,8 @@ bool EventHub::getEvent(int32_t* outDeviceId, int32_t* outType, } //printf("poll %d, returned %d\n", mFDCount, pollres); - if(mFDs[0].revents & POLLIN) { - read_notify(mFDs[0].fd); - } + + // mFDs[0] is used for inotify, so process regular events starting at mFDs[1] for(i = 1; i < mFDCount; i++) { if(mFDs[i].revents) { LOGV("revents for %d = 0x%08x", i, mFDs[i].revents); @@ -357,6 +356,12 @@ bool EventHub::getEvent(int32_t* outDeviceId, int32_t* outType, } } } + + // read_notify() will modify mFDs and mFDCount, so this must be done after + // processing all other events. + if(mFDs[0].revents & POLLIN) { + read_notify(mFDs[0].fd); + } } } @@ -607,7 +612,7 @@ int EventHub::open_device(const char *deviceName) sprintf(propName, "hw.keyboards.%u.devname", publicID); property_set(propName, devname); - LOGI("New keyboard: publicID=%d device->id=%d devname='%s propName='%s' keylayout='%s'\n", + LOGI("New keyboard: publicID=%d device->id=%d devname='%s' propName='%s' keylayout='%s'\n", publicID, device->id, devname, propName, keylayoutFilename); } |