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

Doesn't open when launching #1260

Closed
perry-mitchell opened this issue Dec 9, 2023 · 10 comments · Fixed by #1262, #1263 or #1265
Closed

Doesn't open when launching #1260

perry-mitchell opened this issue Dec 9, 2023 · 10 comments · Fixed by #1262, #1263 or #1265

Comments

@perry-mitchell
Copy link
Member

After #1229, the app no longer opens when launching it from the taskbar. It should, however, regardless of the minimised-at-launch setting value.

Buttercup should follow this behaviour:

Minimised-at-launch Launch type Outcome
No Startup Open
No Taskbar Open
Yes Startup Hidden
Yes Taskbar Open
@perry-mitchell
Copy link
Member Author

perry-mitchell commented Dec 9, 2023

Note that this also affects the window re-opening after updates. It should re-open after an update.

We probably need to remove the setting and just use a --minimised flag in the auto-start config.

EDIT: Apparently auto-launch supports options.isHidden..

@Oxalin
Copy link
Contributor

Oxalin commented Dec 10, 2023

The option is working exactly as I intended it to behave: Buttercup starts in the background when launching it from the taskbar or at startup if the option is enabled, because we don't have needs for the main window at this time. If we choose to, we can either open the main window (from the tray or by launching the app a second time from the taskbar or from the menu) or interact with Buttercup through its tray icon.

From what I understand of your scenarios, you expect "start application in background" to be applied only on startup launch, which is not how I had it planned. We could either add another option to separate both scenarios: auto-start in background and always start in background, with a clear description to distinguish their behavior. What do you think?

About auto-launch supporting "isHidden", it only adds an argument to be passed when calling the app. Then you have to manage it, exactly like we do with the "start application in background" option or with the "hidden" arg we already support from the command line.

@perry-mitchell
Copy link
Member Author

perry-mitchell commented Dec 11, 2023

Ok, well a simple misunderstanding then. I think the hidden on startup is more intuitive, and this creates a broken experience when you click on the launcher, expecting the app to open. Also if you click on the item in the task icons area it should open the GUI.

I'd be fine with rephrasing this setting to be more explicit, and adding the functionality so that it's only hidden on launch, not click/exec. Some combination of all of these features would be best.

@Oxalin
Copy link
Contributor

Oxalin commented Dec 13, 2023

Is this supposed to be supported on Linux and macOS? I can test on Linux, but not macOS.

@Oxalin
Copy link
Contributor

Oxalin commented Dec 13, 2023

It won't work under Linux: app.[set,get]LoginItemSettings() functions are only available on macOS and Windows. That's why I had opted to use the node-auto-launch module.

@perry-mitchell
Copy link
Member Author

perry-mitchell commented Dec 14, 2023 via email

@perry-mitchell
Copy link
Member Author

I migrated the functionality across just for Linux, to create a desktop file. I can see it creating the file just fine, so I'll test it on my Debian machine this morning before release.

@Oxalin
Copy link
Contributor

Oxalin commented Dec 14, 2023

Ok. What about macOS which has its own trickeries (and no args support from native calls)? Is there anyone who could test it?

@georglauterbach
Copy link

georglauterbach commented Dec 14, 2023

When there is a release, I will test it on macOS. I lack the time to build it myself, hence I can only report once a release has been published.

@perry-mitchell
Copy link
Member Author

perry-mitchell commented Dec 14, 2023

I've published it.

Yes, I can see that MacOS doesn't like my hybrid setting. It'll need some more work.

Hopefully this is enough for mac:

openAsHidden boolean (optional) macOS - true to open the app as hidden. Defaults to false. The user can edit this setting from the System Preferences so app.getLoginItemSettings().wasOpenedAsHidden should be checked when the app is opened to know the current value. This setting is not available on MAS builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment