diff --git a/README.md b/README.md index cd8e208..a0a1923 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,6 @@ This includes if you copied a sufficiently large bit of text into the persistent The catch is, it wipes your settings. As the settings are always in RAM, and contain just about every *fixable* thing that can break your boot, nuking them should bring you to defaults. -It seems to take just under a second for a key event to get through, yet drags are fine. -I don't know why this is, but I suspect the answer involves the timing of a `computer.pullSignal()` with no timeout. -If you particularly find performance important, and don't mind the energy costs, you can modify the `init.lua` to make it so that the kernel wakes up every tick. - And finally, just because a system can multitask somewhat on 192K doesn't mean it can do the impossible regarding memory usage. Lesson learned: Cleaner design -> Higher memory usage. So anyone who wants the design to be made even cleaner should probably reread this paragraph. diff --git a/code/apps/sys-glacier.lua b/code/apps/sys-glacier.lua index 68462c8..5bcf14e 100644 --- a/code/apps/sys-glacier.lua +++ b/code/apps/sys-glacier.lua @@ -83,6 +83,9 @@ local currentGPUBinding = {} -- [gpuAddr] = userCount local currentGPUUsers = {} +-- Thanks to Skye for this! +local keyboardMonCacheK, keyboardMonCacheV = nil + local function announceFreeMonitor(address, except) for k, v in pairs(targsRD) do if k ~= except then @@ -238,14 +241,19 @@ donkonitRDProvider(function (pkg, pid, sendSig) end} return { getMonitorByKeyboard = function (kb) + if keyboardMonCacheK == kb.address then + return keyboardMonCacheV + end for v in screens.list() do for _, v2 in ipairs(v.getKeyboards()) do if v2 == kb then + keyboardMonCacheK, keyboardMonCacheV = kb.address, v.address return v.address end end end end, + getClaimable = function () local c = {} -- do we have gpu? @@ -312,6 +320,7 @@ local function rescanDevs() monitorPool = {} currentGPUBinding = {} currentGPUUsers = {} + keyboardMonCacheK, keyboardMonCacheV = nil, nil local hasGPU = gpus.list()() for k, v in pairs(monitorClaims) do v[2](true)