JunoLab / atom-ink

IDE toolkit for Atom
MIT License
228 stars 40 forks source link

Ink console stealing focus #131

Closed mauricioszabo closed 6 years ago

mauricioszabo commented 7 years ago

Ok, here's my strange problem...

I think it started happening about a month ago, when I updated Ink. Problem is, somehow ink is stealing focus on my editor. I don't really know why or when exactly this behavior started.

One simple way to reproduce it is to bind the following key:

'atom-workspace':
  'shift-enter': 'window:focus-next-pane'

Then hit a keystroke to start ink console (I use proto-repl, so I hit a keystroke to connect to a remote repl and it opens Ink for me). Then, focus goes to ink console. Then I hit shift-enter to go back to my editor.

Now, sometimes, when I hit some keystroke to open tree view (or to close it), focus goes to ink console. If I hit a keystroke to resize pane, focus changes to ink. It seems to happen randomly....

Here's a simple video. As you can see, it doesn't seem to follow some kind of logic...

https://drive.google.com/file/d/0BxtWUfDc8tIoeW5iYTRKeXk3Vmc/view

(File is on my google drive because it's too big to be embeded here...)

pfitzseb commented 7 years ago

Oh wow, this was kinda tricky to figure out. Solved now though :)

I do think this is an Atom core bug though (either implementation or documentation, but most likely the latter). We'll have to see how the TextEditor.onDidChange behaviour changes (heh) in the future and maybe adjust this code accordingly.

mauricioszabo commented 7 years ago

Wow, I must admit that was way faster that I imagined. Thanks! I'm testing it now, but seems its working!

mauricioszabo commented 7 years ago

Well, it's better but it's still stealing focus, specially when I use a keystroke to resize splits...

pfitzseb commented 7 years ago

Okay, I don't see any focus stealing when resizing panes with keystrokes at all, so not sure I can do anything about this unless I can reproduce the issue. Is your Atom installation up-to-date?

mauricioszabo commented 7 years ago

Yes, my Atom is up to date. I'm using the master branch with proto-repl.

I'll try to reproduce the focus stealing behavior and post here. The problem is that this behavior is somewhat random, so it's kinda hard to find a sequence of keystrokes that cause the problem....

pfitzseb commented 6 years ago

Should be fixed with the new console implementation.