From c3beb48fa3d8d5cab2decf7411f8f47eb6f5a252 Mon Sep 17 00:00:00 2001 From: Ryan Hanson Date: Thu, 16 Jan 2020 10:26:11 +0100 Subject: [PATCH] Fixed bug with non-resizable windows not working properly for centering and moving across displays --- Rectangle.xcodeproj/project.pbxproj | 8 ++++---- Rectangle/WindowAction.swift | 6 +++--- Rectangle/WindowManager.swift | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Rectangle.xcodeproj/project.pbxproj b/Rectangle.xcodeproj/project.pbxproj index a7ad5a944..11fe336d8 100644 --- a/Rectangle.xcodeproj/project.pbxproj +++ b/Rectangle.xcodeproj/project.pbxproj @@ -993,7 +993,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 22; + CURRENT_PROJECT_VERSION = 23; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; INFOPLIST_FILE = Rectangle/Info.plist; @@ -1002,7 +1002,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 0.18; + MARKETING_VERSION = 0.19; PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.Rectangle; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1019,7 +1019,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 22; + CURRENT_PROJECT_VERSION = 23; DEVELOPMENT_TEAM = XSYZ3E4B7D; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Rectangle/Info.plist; @@ -1028,7 +1028,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 0.18; + MARKETING_VERSION = 0.19; PRODUCT_BUNDLE_IDENTIFIER = com.knollsoft.Rectangle; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Rectangle/WindowAction.swift b/Rectangle/WindowAction.swift index 4aa6deccb..64601b9b9 100644 --- a/Rectangle/WindowAction.swift +++ b/Rectangle/WindowAction.swift @@ -199,10 +199,10 @@ enum WindowAction: Int { } } - var isDirectionalMove: Bool { + var resizes: Bool { switch self { - case .moveUp, .moveDown, .moveLeft, .moveRight: return true - default: return false + case .moveUp, .moveDown, .moveLeft, .moveRight, .center, .nextDisplay, .previousDisplay: return false + default: return true } } diff --git a/Rectangle/WindowManager.swift b/Rectangle/WindowManager.swift index 204fce702..9417cee71 100644 --- a/Rectangle/WindowManager.swift +++ b/Rectangle/WindowManager.swift @@ -106,7 +106,7 @@ class WindowManager { let visibleFrameOfDestinationScreen = NSRectToCGRect(calcResult.screen.visibleFrame) - let useFixedSizeMover = !frontmostWindowElement.isResizable() && !action.isDirectionalMove + let useFixedSizeMover = !frontmostWindowElement.isResizable() && action.resizes let windowMoverChain = useFixedSizeMover ? fixedSizeWindowMoverChain : standardWindowMoverChain