-
Notifications
You must be signed in to change notification settings - Fork 582
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: pr-fix, pr-change, pr-feature, pr-maintenance
@@ -224,11 +224,11 @@ 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 | |||
timer.doAfter(0.01,function()windows[selected]:focus()end) -- el cap bugs out (desktop "floats" on top) if done directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW El Capitan is no longer supported by Hammerspoon, so we could see what happens if we remove the timer.doAfter()
wrapper and just directly call windows[selected]:focus()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested. Directly calling it seems to work well for me. Should I change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for not replying - yeah I think we should change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just committed the change
El Capitan is no longer supported by Hammerspoon, so we no longer need the timer delay workaround.
@@ -224,11 +224,11 @@ 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 | |||
function()windows[selected]:focus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(E011) expected identifier near '('
Window switching with hs.window.switcher is noticeably slower than the default cmd-tab. This small patch decreases various timers to make the speed feel the same. Note: I decreased a timer that's supposed to prevent an el cap bug, but I couldn't test if this reintroduces the el cap issue.