quarnster/SublimeClang — Issue #34: Steals focus when hiding/showing output panel
Author: rchl
Created: 2012-02-12 19:00:22+00:00
State: open

With big projects, SublimeClang can take a while (few seconds) after focusing the file, before it finishes parsing.

When it finishes, it can either open the panel ("show_output_panel" option) or close ("hide_output_when_empty" option) when there are no issues. When either of these options is enabled, it becomes impossible to work in the long run because showing/hiding panel appears to steal focus from other toolbars.

So if switch to a file and start searching for something immediately, when parsing finishes, plugin opens the panel which closes the find panel and instead of searching I start inserting character in the random place in the document.

Also with "hide_output_when_empty" enabled and panel hidden, it still steals focus when there are no issues because, I assume, it calls "window.run_command("hide_panel", {"panel": "output.clang"})" regardless.

I suppose that might be mostly a ST2 problem that panels steal focus but was wondering if there is something that can be done about that in a plugin.

If nothing else, the "hide_output_when_empty" option, when enabled, should not have any effect when panel is already closed. I suppose it would be easy fix if it's possible to detect whether panel is already open.