From 3b6ad6b3c9b183418e0faae7c1822a22a5e1f25a Mon Sep 17 00:00:00 2001 From: Kai Azim Date: Mon, 8 Jul 2024 21:36:25 -0600 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Ability=20to=20ignore=20fullscr?= =?UTF-8?q?een=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme | 2 +- Loop/Extensions/Defaults+Extensions.swift | 3 ++- Loop/Localizable.xcstrings | 3 +++ Loop/Luminare/Loop/AdvancedConfiguration.swift | 5 +++++ Loop/Managers/LoopManager.swift | 7 ++++++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme b/Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme index ff96d07c..dfd78761 100644 --- a/Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme +++ b/Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme @@ -10,7 +10,7 @@ ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> ("radialMenuVisibility", default: true, iCloud: true) - static let disableCursorInteraction = Key("disableCursorInteraction", default: false, iCloud: true) static let radialMenuCornerRadius = Key("radialMenuCornerRadius", default: 50, iCloud: true) static let radialMenuThickness = Key("radialMenuThickness", default: 22, iCloud: true) @@ -91,6 +90,8 @@ extension Defaults.Keys { // Advanced static let animateWindowResizes = Key("animateWindowResizes", default: false, iCloud: true) // BETA + static let disableCursorInteraction = Key("disableCursorInteraction", default: false, iCloud: true) + static let ignoreFullscreen = Key("excludeFullscreen", default: false, iCloud: true) static let hideUntilDirectionIsChosen = Key("hideUntilDirectionIsChosen", default: false, iCloud: true) static let hapticFeedback = Defaults.Key("hapticFeedback", default: true, iCloud: true) diff --git a/Loop/Localizable.xcstrings b/Loop/Localizable.xcstrings index 0e8222de..2c8cb17c 100644 --- a/Loop/Localizable.xcstrings +++ b/Loop/Localizable.xcstrings @@ -1990,6 +1990,9 @@ }, "Every loop brings you closer to the treasure that awaits." : { + }, + "Exclude fullscreen windows" : { + }, "Excluded Apps" : { "localizations" : { diff --git a/Loop/Luminare/Loop/AdvancedConfiguration.swift b/Loop/Luminare/Loop/AdvancedConfiguration.swift index b81af96d..30370bc4 100644 --- a/Loop/Luminare/Loop/AdvancedConfiguration.swift +++ b/Loop/Luminare/Loop/AdvancedConfiguration.swift @@ -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 } } @@ -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) diff --git a/Loop/Managers/LoopManager.swift b/Loop/Managers/LoopManager.swift index d0a534bf..46fa1760 100644 --- a/Loop/Managers/LoopManager.swift +++ b/Loop/Managers/LoopManager.swift @@ -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 { From 4cc17a64e8298c85ecf8e9d0fdac393025327033 Mon Sep 17 00:00:00 2001 From: Kai Azim Date: Mon, 8 Jul 2024 21:37:20 -0600 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9E=20Fix=20small=20inconsistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loop/Extensions/Defaults+Extensions.swift | 2 +- Loop/Localizable.xcstrings | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Loop/Extensions/Defaults+Extensions.swift b/Loop/Extensions/Defaults+Extensions.swift index 71e7b763..4ba6edd7 100644 --- a/Loop/Extensions/Defaults+Extensions.swift +++ b/Loop/Extensions/Defaults+Extensions.swift @@ -91,7 +91,7 @@ extension Defaults.Keys { // Advanced static let animateWindowResizes = Key("animateWindowResizes", default: false, iCloud: true) // BETA static let disableCursorInteraction = Key("disableCursorInteraction", default: false, iCloud: true) - static let ignoreFullscreen = Key("excludeFullscreen", default: false, iCloud: true) + static let ignoreFullscreen = Key("ignoreFullscreen", default: false, iCloud: true) static let hideUntilDirectionIsChosen = Key("hideUntilDirectionIsChosen", default: false, iCloud: true) static let hapticFeedback = Defaults.Key("hapticFeedback", default: true, iCloud: true) diff --git a/Loop/Localizable.xcstrings b/Loop/Localizable.xcstrings index 2c8cb17c..634ef0fb 100644 --- a/Loop/Localizable.xcstrings +++ b/Loop/Localizable.xcstrings @@ -1990,9 +1990,6 @@ }, "Every loop brings you closer to the treasure that awaits." : { - }, - "Exclude fullscreen windows" : { - }, "Excluded Apps" : { "localizations" : { @@ -3444,6 +3441,9 @@ } } } + }, + "Ignore fullscreen windows" : { + }, "Import" : { "localizations" : {