Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to activate app without showing the main window #90

Closed
cbenhagen opened this issue Mar 7, 2022 · 7 comments
Closed

Add method to activate app without showing the main window #90

cbenhagen opened this issue Mar 7, 2022 · 7 comments

Comments

@cbenhagen
Copy link
Contributor

Similar to focus but without showing the main window. On macOS this would only call NSApp.activate(ignoringOtherApps: true). Our app is mostly just the menu in the system tray (using https://github.com/leanflutter/tray_manager). Therefore it would be nice to be able to activate it without showing the main window which currently is only its settings. Activating is for example needed before showing an alert window.

Maybe there could also be an optional parameter showWindow on the focus method which defaults to true?

@lijy91
Copy link
Member

lijy91 commented Mar 8, 2022

Can you call the hide method to hide the main window? it sounds logically similar to biyi.

@cbenhagen
Copy link
Contributor Author

The main window is already hidden. But using the focus method will show it.

@lijy91
Copy link
Member

lijy91 commented Mar 8, 2022

Why call focus if the window is hidden?

@lijy91
Copy link
Member

lijy91 commented Mar 8, 2022

Can you share a screenshot or video to introduce your product features?

@cbenhagen
Copy link
Contributor Author

The app can show native alert windows which need focus. But maybe activating should be a feature of that plugin. I also opened an issue there. zonble/flutter_platform_alert#2

@lijy91
Copy link
Member

lijy91 commented Mar 8, 2022

I solved this by modifying flutter_platform_alert, you can check out my fork, and I created a PR for flutter_platform_alert.

https://github.com/lijy91/flutter_platform_alert
zonble/flutter_platform_alert#3

@lijy91 lijy91 closed this as completed Mar 8, 2022
@cbenhagen
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants