Skip to content

Commit

Permalink
Merge pull request #498 from `MrKai77/mrkai77/loop-380-disable-in-ful…
Browse files Browse the repository at this point in the history
…lscreen-mode`
  • Loading branch information
SenpaiHunters authored Jul 9, 2024
2 parents 6361718 + 4cc17a6 commit c548671
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "$SRCROOT/assets/set_build_number.sh&#10;/usr/bin/xattr -cr ~/Library/Developer/Xcode/DerivedData&#10;"
scriptText = "$SRCROOT/assets/set_build_number.sh&#10;"
shellToInvoke = "/bin/bash">
<EnvironmentBuildable>
<BuildableReference
Expand Down
3 changes: 2 additions & 1 deletion Loop/Extensions/Defaults+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ extension Defaults.Keys {

// Radial Menu
static let radialMenuVisibility = Key<Bool>("radialMenuVisibility", default: true, iCloud: true)
static let disableCursorInteraction = Key<Bool>("disableCursorInteraction", default: false, iCloud: true)
static let radialMenuCornerRadius = Key<CGFloat>("radialMenuCornerRadius", default: 50, iCloud: true)
static let radialMenuThickness = Key<CGFloat>("radialMenuThickness", default: 22, iCloud: true)

Expand Down Expand Up @@ -91,6 +90,8 @@ extension Defaults.Keys {

// Advanced
static let animateWindowResizes = Key<Bool>("animateWindowResizes", default: false, iCloud: true) // BETA
static let disableCursorInteraction = Key<Bool>("disableCursorInteraction", default: false, iCloud: true)
static let ignoreFullscreen = Key<Bool>("ignoreFullscreen", default: false, iCloud: true)
static let hideUntilDirectionIsChosen = Key<Bool>("hideUntilDirectionIsChosen", default: false, iCloud: true)
static let hapticFeedback = Defaults.Key<Bool>("hapticFeedback", default: true, iCloud: true)

Expand Down
3 changes: 3 additions & 0 deletions Loop/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3441,6 +3441,9 @@
}
}
}
},
"Ignore fullscreen windows" : {

},
"Import" : {
"localizations" : {
Expand Down
5 changes: 5 additions & 0 deletions Loop/Luminare/Loop/AdvancedConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class AdvancedConfigurationModel: ObservableObject {
didSet { Defaults[.disableCursorInteraction] = disableCursorInteraction }
}

@Published var ignoreFullscreen = Defaults[.ignoreFullscreen] {
didSet { Defaults[.ignoreFullscreen] = ignoreFullscreen }
}

@Published var hapticFeedback = Defaults[.hapticFeedback] {
didSet { Defaults[.hapticFeedback] = hapticFeedback }
}
Expand Down Expand Up @@ -70,6 +74,7 @@ struct AdvancedConfigurationView: View {
isOn: $model.animateWindowResizes
)
LuminareToggle("Disable cursor interaction", isOn: $model.disableCursorInteraction)
LuminareToggle("Ignore fullscreen windows", isOn: $model.ignoreFullscreen)
LuminareToggle("Hide until direction is chosen", isOn: $model.hideUntilDirectionIsChosen)
LuminareToggle("Haptic feedback", isOn: $model.hapticFeedback)

Expand Down
7 changes: 6 additions & 1 deletion Loop/Managers/LoopManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ private extension LoopManager {
}

targetWindow = WindowEngine.getTargetWindow()
guard targetWindow?.isAppExcluded != true else { return }
guard
targetWindow?.isAppExcluded != true,
(targetWindow?.fullscreen ?? false && Defaults[.ignoreFullscreen]) == false
else {
return
}

// Only recalculate wallpaper colors if Loop was last triggered over 5 seconds ago
if Defaults[.processWallpaper], lastLoopActivation.distance(to: .now) > 5.0 {
Expand Down

0 comments on commit c548671

Please sign in to comment.