- Electron version: the one bundled with Atom 1.7.1, also 0.36.0
- Operating system: Linux

The "focus()" call does not actually focus the window, it only raises it. Focus remains in the caller app (terminal, for instance).

No "focus stealing prevention" is used. This can be reproduced on multiple window managers (xfwm, unity).

Steps to reproduce, using Atom (as an example -- works with any other Electron-based app that focuses itself):
1. open terminal
2. `atom myfile.txt`
3. switch back to terminal
4. `atom myfile.txt`
5. note that Atom raised itself, but the focus is still in terminal.

atom/browser/native_window_views.cc
return base::UTF8ToUTF16(title_);
}
bool NativeWindowViews::ShouldHandleSystemCommands() const {
  return true;
}
views::Widget* NativeWindowViews::GetWidget() {
  return window_.get();
}
const views::Widget* NativeWindowViews::GetWidget() const {
  return window_.get();
}
views::View* NativeWindowViews::GetContentsView() {
  return this;
}
bool NativeWindowViews::ShouldDescendIntoChildForEventHandling(
    gfx::NativeView child,
    const gfx::Point& location) {
  
  if (draggable_region() &&
      draggable_region()->contains(location.x(), location.y()))
    return false;
  
  if (!has_frame() && CanResize()) {
    FramelessView* frame = static_cast<FramelessView*>(
        window_->non_client_view()->frame_view());
    return frame->ResizingBorderHitTest(location) == HTNOWHERE;
  }
  return true;
}
views::ClientView* NativeWindowViews::CreateClientView(views::Widget* widget) {