From 94b77d099844c84903b338a6465cc54017a9a62c Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 11:59:59 -0500 Subject: [PATCH] Separate the offset determination from the dimensions. --- src/browser/atom-application.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index f6934761a..a5a535b93 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -360,15 +360,18 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() - # Get the dimensions for opening a new window by cascading as appropriate to - # the platform. - getDimensionsForNewWindow: -> + # Get the platform-specific window offset for new windows. + getWindowOffsetForCurrentPlatform: -> offsetByPlatform = darwin: 22 win32: 26 + offsetByPlatform[process.platform] ? 0 + # Get the dimensions for opening a new window by cascading as appropriate to + # the platform. + getDimensionsForNewWindow: -> dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() - offset = offsetByPlatform[process.platform] + offset = @getWindowOffsetForCurrentPlatform() if dimensions? and offset? dimensions.x += offset dimensions.y += offset