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

Slow loading of window behaviors #25

Closed
jaidetree opened this issue Sep 6, 2019 · 2 comments
Closed

Slow loading of window behaviors #25

jaidetree opened this issue Sep 6, 2019 · 2 comments
Labels
develop develop branch

Comments

@jaidetree
Copy link
Collaborator

Reproduction

  1. Press cmd-space j or cmd-space w cmd+j

Expected

The command should run immediately and the alert window should close immediately

Actual

Those commands take a moment to fire and the alert window lingers for a second or two.

@jaidetree
Copy link
Collaborator Author

jaidetree commented Sep 6, 2019

This was reported by a friend trying out the develop branch.

There's a couple of smaller issues wrapped up in this. The performance issues should be fixable and are likely caused by how I'm lazy loading a menu item action. For instance windows:jump would require the windows module and call the jump function. We may be able to cache that better so we can avoid re-reloading modules.

The other part, where the alert window lingers was intended. Actions can be marked as repeatable. Let's say you want to jump 3 windows to the right, you can press:

cmd+space w cmd+l cmd+l cmd+l

When an action is repeatable it sets a timer to wait for repeated keypresses from the currently open menu. When the timer fires, we close the menu and disable the hotkey modal.

To improve this, multiple ideas come to mind:

  1. Display an animated progress bar representing the repeating timer. The vim module has an example of drawing a box at a specific size at a specific placement on the screen.
  2. Hide the modal when an action is triggered but key the hotkey modal active for the duration of the timer. This is significantly easier than option Other keys should be disabled when modal is active #1 but may lead to confusing behavior on more complicated configs.
  3. Remove the repeatable: true from the default actions. The easiest option of the 3. It may make the menu behave more as expected but then people may miss that feature.

@agzam agzam added the develop develop branch label Jan 2, 2020
@jaidetree
Copy link
Collaborator Author

This was fixed with updating the fsm library. May have also been caused by a build up of log data that slows Hammerspoon down. That was patched upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
develop develop branch
Projects
None yet
Development

No branches or pull requests

2 participants