Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up window switching timers #3237

Merged
merged 4 commits into from
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions extensions/window/window_switcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,16 @@ local function exit(self)
-- if windows[selected]:application():bundleID()~='com.apple.finder' then
-- windows[selected]:focus()
-- else
timer.doAfter(0.15,function()windows[selected]:focus()end) -- el cap bugs out (desktop "floats" on top) if done directly
windows[selected]:focus()
-- end
end

local MODS_INTERVAL=0.05 -- recheck for (lack of) mod keys after this interval
local MODS_INTERVAL=0.01 -- recheck for (lack of) mod keys after this interval
local function modsPressed()
local mods = checkMods(true)._raw
return mods>0 and mods ~= 65536 -- caps lock
end

local function show(self,dir)
local windows,drawings,ui=self.windows,self.drawings,self.ui
if not windows then
Expand Down Expand Up @@ -261,7 +262,7 @@ local function show(self,dir)
setFrames(nwindows,drawings,ui)
drawings.lastn=nwindows
end
self.drawDelayed=timer.doAfter(0.2,function()
self.drawDelayed=timer.doAfter(0.15,function()
draw(windows,drawings,ui)
end)
self.modsTimer=timer.waitWhile(modsPressed,function()exit(self)end,MODS_INTERVAL)
Expand Down