<commit_before>{BrowserWindow, app, dialog} = require 'electron'
path = require 'path'
fs = require 'fs'
url = require 'url'
_ = require 'underscore-plus'
{EventEmitter} = require 'events'

module.exports =
class AtomWindow
  _.extend @prototype, EventEmitter.prototype

  @iconPath: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
  @includeShellLoadTime: true

  browserWindow: null
  loaded: null
  isSpec: null

  constructor: (settings={}) ->
    {@resourcePath, initialPaths, pathToOpen, locationsToOpen, @isSpec, @headless, @safeMode, @devMode} = settings
    locationsToOpen ?= [{pathToOpen}] if pathToOpen
    locationsToOpen ?= []

    options =
      show: false
      title: 'Atom'
      # Add an opaque backgroundColor (instead of keeping the default
      # transparent one) to prevent subpixel anti-aliasing from being disabled.
      # We believe this is a regression introduced with Electron 0.37.3, and
      # thus we should remove this as soon as a fix gets released.
      backgroundColor: "#fff"
      webPreferences:
        backgroundThrottling: not @isSpec

    # Don't set icon on Windows so the exe's ico will be used as window and
    # taskbar's icon. See https://github.com/atom/atom/issues/4811 for more.
    if process.platform is 'linux'
      options.icon = @constructor.iconPath

    @browserWindow = new BrowserWindow options
    global.atomApplication.addWindow(this)

    @handleEvents()
<commit_msg>:memo: Remember why we added backgroundThrottling<commit_after>{BrowserWindow, app, dialog} = require 'electron'
path = require 'path'
fs = require 'fs'
url = require 'url'
_ = require 'underscore-plus'
{EventEmitter} = require 'events'

module.exports =
class AtomWindow
  _.extend @prototype, EventEmitter.prototype

  @iconPath: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
  @includeShellLoadTime: true

  browserWindow: null
  loaded: null
  isSpec: null

  constructor: (settings={}) ->
    {@resourcePath, initialPaths, pathToOpen, locationsToOpen, @isSpec, @headless, @safeMode, @devMode} = settings
    locationsToOpen ?= [{pathToOpen}] if pathToOpen
    locationsToOpen ?= []

    options =
      show: false
      title: 'Atom'
      # Add an opaque backgroundColor (instead of keeping the default
      # transparent one) to prevent subpixel anti-aliasing from being disabled.
      # We believe this is a regression introduced with Electron 0.37.3, and
      # thus we should remove this as soon as a fix gets released.
      backgroundColor: "#fff"
      webPreferences:
        # Prevent specs from throttling when the window is in the background:
        # this should result in faster CI builds, and an improvement in the
        # local development experience when running specs through the UI (which
        # now won't pause when e.g. minimizing the window).
        backgroundThrottling: not @isSpec

    # Don't set icon on Windows so the exe's ico will be used as window and
    # taskbar's icon. See https://github.com/atom/atom/issues/4811 for more.
    if process.platform is 'linux'
      options.icon = @constructor.iconPath

    @browserWindow = new BrowserWindow options
    global.atomApplication.addWindow(this)

    @handleEvents()

{'fraction_non_alphanumeric': 0.09653465346534654, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 3.502785515320334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5654595', 'n_tokens_mistral': 940, 'n_tokens_neox': 899, 'n_words': 322}