experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(windows): hide other windows AFTER windows view opens

Hiding windows before opening the windows view caused macOS to switch
focus to another app before the windows view could open. Now we open
the windows view first, then hide other windows once it's focused.

+4 -4
+4 -4
extensions/windows/background.js
··· 73 73 * Open the Windows view (maximized, transparent) 74 74 */ 75 75 const openWindowsView = async () => { 76 - // Hide other windows first 77 - await hideOtherWindows(); 78 - 79 76 const params = { 80 77 key: address, 81 78 transparent: true, ··· 93 90 }; 94 91 95 92 api.window.open(address, params) 96 - .then(window => { 93 + .then(async (window) => { 97 94 debug && console.log('[ext:windows] Windows view opened:', window); 95 + // Hide other windows AFTER the windows view is open and focused 96 + // This prevents macOS from switching focus to another app 97 + await hideOtherWindows(); 98 98 }) 99 99 .catch(error => { 100 100 console.error('[ext:windows] Failed to open windows view:', error);