Harden Panama launcher actions
This commit is contained in:
@@ -114,7 +114,10 @@ ShellRoot {
|
||||
IpcHandler {
|
||||
target: "focus"
|
||||
|
||||
function start(): void { FocusSession.startDefault(); }
|
||||
function start(): bool {
|
||||
FocusSession.startDefault();
|
||||
return FocusSession.active;
|
||||
}
|
||||
function reveal(): void { FocusSession.reveal(); }
|
||||
function dismiss(): void { FocusSession.dismiss(); }
|
||||
function pause(): void { FocusSession.pauseOrResume(); }
|
||||
@@ -123,7 +126,12 @@ ShellRoot {
|
||||
ShellState.openOverview(FocusSession.workspaceId);
|
||||
FocusSession.dismiss();
|
||||
}
|
||||
function end(): void { FocusSession.end(false); }
|
||||
function end(): bool {
|
||||
if (!FocusSession.active)
|
||||
return false;
|
||||
FocusSession.end(false);
|
||||
return !FocusSession.active;
|
||||
}
|
||||
function status(): string {
|
||||
return JSON.stringify({
|
||||
active: FocusSession.active,
|
||||
@@ -272,10 +280,21 @@ ShellRoot {
|
||||
IpcHandler {
|
||||
target: "night-light"
|
||||
function toggle(): bool {
|
||||
NightLight.toggle();
|
||||
NightLight.toggleQuietly();
|
||||
return NightLight.active;
|
||||
}
|
||||
function status(): bool { return NightLight.active; }
|
||||
function settings(): string {
|
||||
return JSON.stringify({
|
||||
enabled: NightLight.enabled,
|
||||
automatic: NightLight.automatic,
|
||||
active: NightLight.active
|
||||
});
|
||||
}
|
||||
function restore(enabled: bool, automatic: bool): bool {
|
||||
NightLight.restore(enabled, automatic);
|
||||
return NightLight.active;
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
|
||||
Reference in New Issue
Block a user