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

WindowIconPath = null
idNum = 0

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

  @includeShellLoadTime: true

  browserWindow: null
  loaded: null
  isSpec: null

  constructor: (settings={}) ->
    {frame,
     title,
     width,
     height,
     toolbar,
     resizable,
     pathToOpen,
     showSpecsInWindow,
     @isSpec,
     @devMode,
     @windowKey,
     @safeMode,
     @neverClose,
     @mainWindow,
     @windowType,
     @resourcePath,
     @exitWhenDone,
     @configDirPath} = settings

    if !@windowKey
      @windowKey = "#{@windowType}-#{idNum}"
      idNum += 1

    # Normalize to make sure drive letter case is consistent on Windows
    @resourcePath = path.normalize(@resourcePath) if @resourcePath

    browserWindowOptions =
      show: false
      title: title ? 'Nylas N1'
      frame: frame
      width: width
      height: height
      resizable: resizable
      webPreferences:
        directWrite: true

    if @neverClose
      # Prevents DOM timers from being suspended when the main window is hidden.
      # Means there's not an awkward catch-up when you re-show the main window.
      # TODO
      # This option is no longer working according to
      # https://github.com/atom/electron/issues/3225
      # Look into using option --disable-renderer-backgrounding
      browserWindowOptions.webPreferences.pageVisibility = true

    # 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'
      unless WindowIconPath
        WindowIconPath = path.resolve(__dirname, '..', '..', 'nylas.png')<commit_msg>Enables showing/hiding of menubar (#2648)<commit_after>{BrowserWindow, app, dialog} = require 'electron'
path = require 'path'
fs = require 'fs'
url = require 'url'
_ = require 'underscore'
{EventEmitter} = require 'events'

WindowIconPath = null
idNum = 0

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

  @includeShellLoadTime: true

  browserWindow: null
  loaded: null
  isSpec: null

  constructor: (settings={}) ->
    {frame,
     title,
     width,
     height,
     toolbar,
     resizable,
     pathToOpen,
     showSpecsInWindow,
     @isSpec,
     @devMode,
     @windowKey,
     @safeMode,
     @neverClose,
     @mainWindow,
     @windowType,
     @resourcePath,
     @exitWhenDone,
     @configDirPath} = settings

    if !@windowKey
      @windowKey = "#{@windowType}-#{idNum}"
      idNum += 1

    # Normalize to make sure drive letter case is consistent on Windows
    @resourcePath = path.normalize(@resourcePath) if @resourcePath

    browserWindowOptions =
      show: false
      title: title ? 'Nylas N1'
      frame: frame
      width: width
      height: height
      resizable: resizable
      webPreferences:
        directWrite: true
      autoHideMenuBar: true

    if @neverClose
      # Prevents DOM timers from being suspended when the main window is hidden.
      # Means there's not an awkward catch-up when you re-show the main window.
      # TODO
      # This option is no longer working according to
      # https://github.com/atom/electron/issues/3225
      # Look into using option --disable-renderer-backgrounding
      browserWindowOptions.webPreferences.pageVisibility = true

    # 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'
      unless WindowIconPath
        WindowIconPath = path.resolve(__dirname, '..', '..', 'nylas.png')
{'fraction_non_alphanumeric': 0.0936358894105373, 'fraction_numerical': 0.006781429316640584, 'mean_word_length': 2.789525691699605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '1056000', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1118, 'n_words': 345}