forked from koreader/koreader-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The great input handling spring cleanup (koreader#1332)
* Updated <linux/input.h> FFI stuff in order to be able to use it in front instead of re-declaring everything there. * Fixed lua-rapidjson build w/ CMake >= 3.20 * Added some errno consts to the POSIX ffi module * Added clock_gettime & friends to the POSIX ffi module * Added setpriority & friends to the POSIX ffi module * Added sched_setscheduler & friends to the POSIX ffi module * Stopped storing useless unused references to require'd FFI modules * Switched SDL2 input events to synthetic CLOCK_MONOTONIC (native ones are not helpful, they're relative to the app's startup). * Simplified SDL2 input polling to actually rely on SDL2 instead of implementing a weird timeout handling ourselves. * Preserve input event timestamps on Android, they're in a sane time base (MONOTONIC). * Simplified and documented input polling on Android. We don't actually use the weird delayed-callback mechanism from android_native_app_glue, so, make that clear by relying on ALooper's native API instead of a weird mix of the two. * Made ffiUtil.runInSubProcess tweak the subprocess scheduling and priority to match the use-case: non-interactive background tasks. This ensures that the kernel will schedule it accordingly without requiring weird yield hackery in front. * Revamped input handling on most platforms, and especially on embedded pure-Linux eInk devices: * The C/Lua input module has been modernized and simplified. * Of specific note, the API of waitForEvent has been updated to get rid of protected mode calls in front. This allows us to get rid of the cost of handling throws in an interactivity-sensitive and hot codepath, and makes error-checking much easier, because parsing dynamically generated strings is not my idea of fun. Timeout values are also preserved in a timeval-like format, preventing truncation. * A timerfd backend has been implemented for the "timed callbacks" API required by GestureDetector to handle holds & double-tap detection. This allows us, among other things, to honor the input event's timestamps without having to resort to time-base conversions or hackery on devices where input events use the REALTIME clock source.
- Loading branch information
Showing
33 changed files
with
924 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.