mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 12:55:16 -07:00
fix: settings window z-order on Hyprland and Linux app detach (#85)
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
import type { LauncherCommandContext } from './context.js';
|
||||
|
||||
type AppCommandDeps = {
|
||||
platform: () => NodeJS.Platform;
|
||||
runAppCommandWithInherit: (appPath: string, appArgs: string[]) => void;
|
||||
launchAppBackgroundDetached: (
|
||||
appPath: string,
|
||||
@@ -15,7 +14,6 @@ type AppCommandDeps = {
|
||||
};
|
||||
|
||||
const defaultAppCommandDeps: AppCommandDeps = {
|
||||
platform: () => process.platform,
|
||||
runAppCommandWithInherit,
|
||||
launchAppBackgroundDetached,
|
||||
};
|
||||
@@ -35,7 +33,7 @@ export function runAppPassthroughCommand(
|
||||
if (!args.appPassthrough) {
|
||||
return false;
|
||||
}
|
||||
if (deps.platform() === 'darwin' && args.appArgs.length === 0) {
|
||||
if (args.appArgs.length === 0) {
|
||||
deps.launchAppBackgroundDetached(appPath, args.logLevel);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,25 @@ test('app command starts default macOS background app detached from launcher', (
|
||||
const calls: string[] = [];
|
||||
|
||||
const handled = runAppPassthroughCommand(context, {
|
||||
platform: () => 'darwin',
|
||||
runAppCommandWithInherit: () => {
|
||||
calls.push('attached');
|
||||
},
|
||||
launchAppBackgroundDetached: (appPath, logLevel) => {
|
||||
calls.push(`detached:${appPath}:${logLevel}`);
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(handled, true);
|
||||
assert.deepEqual(calls, ['detached:/tmp/subminer.app:info']);
|
||||
});
|
||||
|
||||
test('app command starts default Linux background app detached from launcher', () => {
|
||||
const context = createContext();
|
||||
context.args.appPassthrough = true;
|
||||
context.args.appArgs = [];
|
||||
const calls: string[] = [];
|
||||
|
||||
const handled = runAppPassthroughCommand(context, {
|
||||
runAppCommandWithInherit: () => {
|
||||
calls.push('attached');
|
||||
},
|
||||
@@ -197,7 +215,6 @@ test('app command keeps explicit passthrough args attached', () => {
|
||||
const detached: string[] = [];
|
||||
|
||||
const handled = runAppPassthroughCommand(context, {
|
||||
platform: () => 'darwin',
|
||||
runAppCommandWithInherit: (_appPath, appArgs) => {
|
||||
forwarded.push(appArgs);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user