Skip to content

Commit

Permalink
Clarify behavior around window focus
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious committed Oct 19, 2023
1 parent f174636 commit f3db852
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/packages/teleterm/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ function setUpDeepLinks(
if (settings.platform === 'darwin') {
// Deep link click on macOS.
app.on('open-url', (event, url) => {
// macOS does bring focus to the _application_ itself. However, if the app has one window and
// When macOS launches an app as a result of a deep link click, macOS does bring focus to the
// _application_ itself if the app is already running. However, if the app has one window and
// the window is minimized, it'll remain so. So we have to focus the window ourselves.
windowsManager.focusWindow();

Expand All @@ -301,6 +302,9 @@ function setUpDeepLinks(

// Deep link click if the app is already opened (Windows or Linux).
app.on('second-instance', (event, argv) => {
// There's already a second-instance listener that gives focus to the main window, so we don't
// do this in this listener.

const url = findCustomProtocolUrlInArgv(argv);
if (url) {
logger.info(`Deep link launch from second-instance, URI: ${url}`);
Expand Down

0 comments on commit f3db852

Please sign in to comment.