Skip to content
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
12 changes: 12 additions & 0 deletions BetterCapture/Model/SettingsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ final class SettingsStore {
}
}

var showBetterCapture: Bool {
get {
access(keyPath: \.showBetterCapture)
return UserDefaults.standard.object(forKey: "showBetterCapture") as? Bool ?? false
}
set {
withMutation(keyPath: \.showBetterCapture) {
UserDefaults.standard.set(newValue, forKey: "showBetterCapture")
}
}
}

// MARK: - Output Settings

/// The default output directory (Documents/BetterCapture)
Expand Down
11 changes: 9 additions & 2 deletions BetterCapture/Service/ContentFilterService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ final class ContentFilterService {
return filter
}

// If both wallpaper and dock are shown, no need to rebuild the filter
if settings.showWallpaper && settings.showDock {
// If both wallpaper and dock are shown and BetterCapture is shown, no need to rebuild the filter
if settings.showWallpaper && settings.showDock && settings.showBetterCapture {
logger.info("No exclusions needed, returning original filter")
return filter
}
Expand Down Expand Up @@ -97,6 +97,13 @@ final class ContentFilterService {
continue
}

// Exclude BetterCapture's own windows if showBetterCapture is false
if !settings.showBetterCapture && bundleID == Bundle.main.bundleIdentifier {
excludedWindows.append(window)
logger.debug("Excluding BetterCapture window: \(windowTitle)")
continue
}

// Wallpaper and Dock are both owned by com.apple.dock
guard bundleID == "com.apple.dock" else { continue }

Expand Down
1 change: 1 addition & 0 deletions BetterCapture/View/MenuBarSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ struct VideoSettingsSection: View {
MenuBarToggle(name: "Show Menu Bar", isOn: $settings.showMenuBar)
MenuBarToggle(name: "Show Dock", isOn: $settings.showDock)
MenuBarToggle(name: "Show Window Shadows", isOn: $settings.showWindowShadows)
MenuBarToggle(name: "Show BetterCapture", isOn: $settings.showBetterCapture)
}

// Frame Rate Picker
Expand Down
1 change: 1 addition & 0 deletions BetterCapture/View/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ struct ContentFilterSettingsView: View {
Toggle("Show Wallpaper", isOn: $settings.showWallpaper)
Toggle("Show Menu Bar", isOn: $settings.showMenuBar)
Toggle("Show Dock", isOn: $settings.showDock)
Toggle("Show BetterCapture", isOn: $settings.showBetterCapture)
}

Section("Window Capture") {
Expand Down