Desktop: Mattermost app is in Windows tab list after hidden auto-start

Created on 22 Mar 2018  路  7Comments  路  Source: mattermost/desktop

I confirm (by marking "x" in the [ ] below: [x]):


https://mattermost.atlassian.net/browse/MM-14071

Summary

When auto-starting Mattermost Desktop on Windows login, the application windows is (correctly) hidden, but it (incorrectly) is still shown in the task bar and shows up in the Alt+Tab list.

Steps to reproduce

On Windows, activate "Start app on login" in the settings. Log off and log in again. Mattermost starts hidden with a tray icon. Observe that no Mattermost application window is shown, but it is active on the task bar, and pressing Alt+Tab shows it in the tab list. (This is reminiscent of issue #233.) After opening the application and closing the window again (the application remains in the tray), it correctly disappears from the task bar and from the Alt+Tab list.

I'm using --disable-gpu to workaround issue #713, but the above problem happens regardless.

This issue applies to Mattermost Desktop version 4.0.0.

Expected behavior

After auto-start, the application should not appear on the task bar and should not show up in the Alt+Tab list.

Observed behavior

After auto-start, the application appears on the task bar and shows up in the Alt+Tab list.

Possible fixes

Help Wanted Up For Grabs Windows

All 7 comments

Sorry for late response. It's intended behavior. The window starts as a minimized window, so it should appear on the task bar and Alt+Tab list.

So we need to decide what is appropriate behavior for startup.

Just for reference. In past issues, your observed behavior is treated as correct.

Thanks for your response.

For Windows applications that have a tray icon or that can minimize to a tray icon, the usual behavior when auto-starting is that they minimize to the tray, i.e. they don't appear in the Alt+Tab list or on the task bar. I currently have about a dozen tray-icon applications running which all work that way. Therefore I would say that this is the more expected behavior for such applications on Windows.

As the Mattermost Desktop application window has both the option of minimizing to the task bar (via "Minimize") and minimizing to the tray (via "Close"), it would make sense to have both options for startup as well (and maybe also the option to auto-start non-minimized; but see below).

When auto-starting an application by (manually) placing a shortcut in the Startup folder, one can configure in the shortcut properties whether the application should start in a normal window or minimized or maximized. This used to work in earlier versions of Mattermost Desktop, but now the application always opens in a normal window regardless of what the shortcut specifies. My point here is that auto-starting in minimized state can normally be achieved using built-in Windows features and doesn't require special application support. Starting/minimizing into the tray, on the other hand, does require application support, and therefore that would be the most important feature to have support for in the application. That is, if Mattermost Desktop would comply with what the shortcut specifies, and only add an option to minimize to the tray instead of to the task bar, then this would be sufficient to enable all use cases and personal preferences.

@yuya-oc Thoughts on the above note?

When auto-starting an application by (manually) placing a shortcut in the Startup folder, one can configure in the shortcut properties whether the application should start in a normal window or minimized or maximized.

@nmatt Just curious, do you know the way to get the configuration in program code? Due to a reason of appearance, for now we need to manually control the window state on startup. (possibly it might be blocking Windows' behavior though)

What about having sub options, minimize(default) and minimize to tray for "Start app on login"?

@yuya-oc: I believe the configured option is passed to WinMain as the value of the _nCmdShow_ parameter. The application then should pass that value to the first invocation of ShowWindow. The value is presumably also set in the STARTUPINFO structure, which can be obtained via the GetStartupInfo.

Having those two options would be good. I would suggest to name the first one "minimize to task bar" just for clarity. It would also be useful to be able to override the startup options using command-line parameters.

Thanks! GetStartupInfo would be an appropriate choice for typical native apps, but it's not easy for Electron because it needs help of its native part or Node's native addon.

So we would be able to follow only new options and command line options.

Was this page helpful?
0 / 5 - 0 ratings