Skip to content

Commit

Permalink
ensure focus is returned to previous app
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-james-watson committed Nov 8, 2021
1 parent 4cfe212 commit 126d483
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions app/main/lib/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ export function createBreakWindows(): void {

breakWindow.setVisibleOnAllWorkspaces(true);

// setVisibleOnAllWorkspaces seems to have a bug that causes the dock to
// unhide when called.
if (process.platform === "darwin") {
// setVisibleOnAllWorkspaces seems to have a bug that causes the dock to
// unhide when called.
app.dock.hide();
}

Expand All @@ -126,6 +126,12 @@ export function createBreakWindows(): void {
});

breakWindow.on("closed", () => {
if (process.platform === "darwin") {
// Ensure that focus is returned to the previous app when break windows
// close.
app.hide();
}

for (const win of breakWindows) {
if (!win.isDestroyed()) {
try {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "breaktimer",
"version": "1.0.2",
"version": "1.0.3",
"productName": "BreakTimer",
"description": "Manage periodic breaks",
"scripts": {
Expand Down

0 comments on commit 126d483

Please sign in to comment.