Input: Process input events in batches (#7483)

Requires https://github.com/koreader/koreader-base/pull/1344 & https://github.com/koreader/koreader-base/pull/1346 (fix #7485)

Assorted input fixes:

* Actually handle errors in the "there's a callback timer" input polling loop.
* Don't break timerfd when the clock probe was inconclusive.

Not directly related, but noticed because of duplicate onInputEvent handlers:

* HookContainer: Fix deregistration to actually deregister properly. "Regression" extant since its inception in #2933 (!).
* Made sure the three plugins (basically the trio of AutoThingies ;p) that were using HookContainer actually unschedule their task on teardown.
This commit is contained in:
NiLuJe
2021-04-03 01:48:35 +02:00
committed by GitHub
parent 25aabd69d9
commit 03e9fac156
10 changed files with 134 additions and 78 deletions

View File

@@ -84,8 +84,8 @@ function PluginLoader:loadPlugins()
for element in pairs(OBSOLETE_PLUGINS) do
plugins_disabled[element] = true
end
for _,lookup_path in ipairs(lookup_path_list) do
logger.info('Loading plugins from directory:', lookup_path)
for _, lookup_path in ipairs(lookup_path_list) do
logger.info("Loading plugins from directory:", lookup_path)
for entry in lfs.dir(lookup_path) do
local plugin_root = lookup_path.."/"..entry
local mode = lfs.attributes(plugin_root, "mode")
@@ -124,7 +124,7 @@ function PluginLoader:loadPlugins()
end
-- set package path for all loaded plugins
for _,plugin in ipairs(self.enabled_plugins) do
for _, plugin in ipairs(self.enabled_plugins) do
package.path = string.format("%s;%s/?.lua", package.path, plugin.path)
package.cpath = string.format("%s;%s/lib/?.so", package.cpath, plugin.path)
end
@@ -193,7 +193,7 @@ function PluginLoader:createPluginInstance(plugin, attr)
if ok then -- re is a plugin instance
return ok, re
else -- re is the error message
logger.err('Failed to initialize', plugin.name, 'plugin: ', re)
logger.err("Failed to initialize", plugin.name, "plugin: ", re)
return nil, re
end
end