Skip to content

Commit

Permalink
Show on current mac workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Aug 7, 2023
1 parent 9f11bd2 commit 9ffcd97
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ function toggleWindow() {
if (window!.isFocused()) {
window!.hide();
} else {
// show on active workspace for mac
if (process.platform === 'darwin') {
window!.setVisibleOnAllWorkspaces(true);
window!.show();
window!.setVisibleOnAllWorkspaces(false);
}
// show on current monitor
const currentScreen = screen.getDisplayNearestPoint(screen.getCursorScreenPoint());
const isWindowOnCurrentScreen =
currentScreen.bounds.x <= window!.getPosition()[0] &&
Expand Down

0 comments on commit 9ffcd97

Please sign in to comment.