Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Ability to ignore fullscreen windows #498

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading