]> git.gir.st - VimFx.git/commit
Fix focus handling
authorSimon Lydell <simon.lydell@gmail.com>
Fri, 27 May 2016 07:29:46 +0000 (09:29 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Fri, 27 May 2016 16:42:56 +0000 (18:42 +0200)
commite9e9b5800646e2c4a71f3407cf7b8831db0d0f19
tree65e290fb466cd38b5b71f156c251616c2d2b5643
parent0f3fbd30450a21b1887b82506c47598de037c28c
Fix focus handling

When blurring a UI element, we handle that blur after a timeout. If
the UI element was blurred due to focusing a frame element, the focus
events for that frame element occurs _before_ handling the UI blur. That
caused the focusType to be set according to the UI blur, and not
according to the frame focus. This meant that if you had the location
bar focused and clicked inside a text input in a web page, VimFx would
enter and then immediately exit "auto insert mode". This commit fixes
this issue by asking the frame script for the focusType if a 'focus' or
'blur' event is caught in the UI and the active element is the current
`<browser>` (instead of treating `<browser>` as focusType 'none').

Also, since commit fee33fa8, 'focusTypeChange' events are only sent when
_changing_ the focusType of a `vim`, _not_ when trying to set the
focusType to the same value as before. While that's good, it caused a
problem when switching tabs. When switching tabs, 'blur' events occur in
the old tab and (re-)'focus' events occur in the new tab, but no
focusType of any `vim` is necessarily changed. However, one tab might be
in "auto insert mode" while the other isn't, so the button would still
need to be updated. Therefore, this commit sends a 'focusTypeChange'
event when switching tabs.

See #738.
extension/lib/events-frame.coffee
extension/lib/events.coffee
Imprint / Impressum