Skip to content

Commit

Permalink
Cycle displays will no longer traverse to other side of single display
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Hanson committed Apr 9, 2020
1 parent 64130de commit a7ff105
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Rectangle/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Defaults {
static let snapEdgeMarginRight = FloatDefault(key: "snapEdgeMarginRight", defaultValue: 5)
static let centeredDirectionalMove = OptionalBoolDefault(key: "centeredDirectionalMove")
static let ignoredSnapAreas = IntDefault(key: "ignoredSnapAreas")
static let traverseSingleScreen = OptionalBoolDefault(key: "traverseSingleScreen")
}

class BoolDefault {
Expand Down
5 changes: 4 additions & 1 deletion Rectangle/ScreenDetection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class ScreenDetection {
guard let firstScreen = screens.first else { return nil }

if screens.count == 1 {
let adjacentScreens = AdjacentScreens(prev: firstScreen, next: firstScreen)
let adjacentScreens = Defaults.traverseSingleScreen.enabled == true
? AdjacentScreens(prev: firstScreen, next: firstScreen)
: nil

return UsableScreens(currentScreen: firstScreen, adjacentScreens: adjacentScreens, numScreens: screens.count)
}

Expand Down

0 comments on commit a7ff105

Please sign in to comment.