Skip to content

Commit

Permalink
Fix bug with swapped stage manager position for RTL languages
Browse files Browse the repository at this point in the history
  • Loading branch information
rxhanson committed Apr 28, 2024
1 parent d326390 commit b993097
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Rectangle/Utilities/StageUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ class StageUtil {
}

static var stageStripPosition: StageStripPosition {
guard let value = dockDefaults?.object(forKey: "orientation") as? String else {
switch dockDefaults?.string(forKey: "orientation") {
case "left":
return .right
case "right":
return .left
default: // bottom
var isRTL = false
if #available(macOS 13, *), Locale.current.language.characterDirection == .rightToLeft {
isRTL = true
}
return isRTL ? .right : .left
}
return value == "left" ? .right : .left
}

static func isStageStripVisible(_ screen: NSScreen? = .main) -> Bool {
Expand Down

0 comments on commit b993097

Please sign in to comment.