Skip to content

Commit ae2d087

Browse files
committed
feat: change the default keepRunning to true
1 parent f4c8ebf commit ae2d087

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

apps/finicky/src/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var dryRun bool = false
6868
var updateInfo UpdateInfo
6969
var configInfo *ConfigInfo
7070
var currentConfigState *config.ConfigState
71-
var shouldKeepRunning bool = false
71+
var shouldKeepRunning bool = true
7272

7373
func main() {
7474
startTime := time.Now()
@@ -234,7 +234,7 @@ func getKeepRunning() bool {
234234
return false
235235
}
236236

237-
keepRunning, err := vm.Runtime().RunString("finickyConfigAPI.getOption('keepRunning', finalConfig, false)")
237+
keepRunning, err := vm.Runtime().RunString("finickyConfigAPI.getOption('keepRunning', finalConfig, true)")
238238
if err != nil {
239239
return false
240240
}

apps/finicky/src/main.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ @implementation BrowseAppDelegate
1717
- (instancetype)initWithForceOpenWindow:(bool)forceOpenWindow initShow:(bool)showMenuItem keepRunning:(bool)keepRunning {
1818
self = [super init];
1919
if (self) {
20-
_forceOpenWindow = forceOpenWindow;
21-
_showMenuItem = showMenuItem;
22-
_keepRunning = keepRunning;
23-
_receivedURL = false;
20+
_forceOpenWindow = forceOpenWindow;
21+
_showMenuItem = showMenuItem;
22+
_keepRunning = keepRunning;
23+
_receivedURL = false;
2424
}
2525
return self;
2626
}
@@ -112,7 +112,10 @@ - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
112112
self.receivedURL = true;
113113

114114
NSRunningApplication *frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication];
115-
bool finickyIsInFront = [frontApp isEqual:[NSRunningApplication currentApplication]];
115+
116+
// Assume Finicky is in front if we are not keeping running, since there's no good way
117+
// to detect if Finicky was launched in the background
118+
bool finickyIsInFront = !self.keepRunning || [frontApp isEqual:[NSRunningApplication currentApplication]];
116119

117120
if (application) {
118121
NSString *appName = [application localizedName];

0 commit comments

Comments
 (0)