Skip to content

fix(app): show window on activate on macOS - #852

Merged
ShGKme merged 1 commit into
mainfrom
fix/reopen-window-on-mac
Oct 28, 2024
Merged

fix(app): show window on activate on macOS#852
ShGKme merged 1 commit into
mainfrom
fix/reopen-window-on-mac

Conversation

@ShGKme

@ShGKme ShGKme commented Oct 26, 2024

Copy link
Copy Markdown
Contributor

☑️ Resolves

Unlike other OS, when all windows are closed on macOS, the app is still kept running (app's menu bar is active, icon in the Dock looks like open's app icon).

New click on the Dock icon should "activate" the app and create the window again.

But the window is created hidden by default (stays in the system tray).

The fix - explicitly show the window on activate.

@ShGKme ShGKme added bug Something isn't working 3. to review os: macOS 🍎 labels Oct 26, 2024
@ShGKme ShGKme self-assigned this Oct 26, 2024
Comment thread src/main.js Outdated
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
mainWindow = createMainWindow()
mainWindow.show()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to wrap mainWindow into once listener, like in other places? Or it won't work because of app.on / MacOS specific handling?

Suggested change
mainWindow.show()
mainWindow.once('ready-to-show', () => mainWindow.show()))

@nickvergessen

Copy link
Copy Markdown
Member

@Ivansss @SystemKeeper does this match the MacOS user expectation?

@Ivansss

Ivansss commented Oct 28, 2024

Copy link
Copy Markdown
Member

does this match the MacOS user expectation?

Yes, clicking on the Dock icon and create and show the window again would match user expectations.

@ShGKme
ShGKme requested a review from Antreesy October 28, 2024 15:08
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme
ShGKme force-pushed the fix/reopen-window-on-mac branch from 19a10cc to edd11d9 Compare October 28, 2024 15:57
@ShGKme
ShGKme enabled auto-merge October 28, 2024 15:57
@ShGKme
ShGKme merged commit 4ae4add into main Oct 28, 2024
@ShGKme
ShGKme deleted the fix/reopen-window-on-mac branch October 28, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working os: macOS 🍎

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nextcloud Talk window cannot be reopened after closing on macOS

4 participants