mozilla-mobile / mozilla-vpn-client

A fast, secure and easy to use VPN. Built by the makers of Firefox.
https://vpn.mozilla.org
Other
442 stars 103 forks source link

Minimize to tray when "Connect VPN on Startup" enabled on Linux #9347

Open mdpenguin opened 2 months ago

mdpenguin commented 2 months ago

Describe the bug When connecting at startup, the application screen comes up instead of being minimized to the tray like in Windows

VPN version: 2.21.0 (2.21.0-jammy1)

Affected Platforms: Linux Mint 21.3 and probably other Ubuntu derivatives

Steps to reproduce:

  1. Set "Connect VPN on startup" option to true in client
  2. Log out and log back in or restart computer

Expected result: Client starts minimized to tray

Actual result: Client is opened and visible

┆Issue is synchronized with this Jira Bug

data-sync-user commented 2 months ago

➤ Valentina Virlics commented:

Thank you for logging this!

I can confirm I am able to reproduce this while on Jammy (physical machine), using Mozilla VPN 2.21 build. After device restart the client is in foreground and automatically turned on.

I was not able to reproduce this while on Linux Noble using latest 2.22 build. The app is minimized after device restart if the start on boot option is enabled. While on Linux Focal and Minotaur using Mozilla VPN 2.21, the app is not opened at all. After opening it gets automatically turned on.

Important note: Linux Noble, Focal and Minotaur versions are on the VM machines.

Maybe Lesley Norton, can confirm if the expected results are also the intended behavior currently in the Mozilla VPN client.

lesleyjanenorton commented 2 months ago

Strange! Thank you for filing. I'm actually not sure that we have defined desired behavior for this though my expectation would also be "Client starts minimized to tray". Is this behavior new in 2.21?

Any ideas @oskirby?

mdpenguin commented 2 months ago

I'm actually not sure that we have defined desired behavior for this though my expectation would also be "Client starts minimized to tray". Is this behavior new in 2.21?

This has been the behavior since I started using this client back in October 24, 2023, though I only recently got around to researching whether there would be a way to make it start minimized.

It appears that the intention is to start it minimized. The command in the .desktop file has the -m flag for opening minimized (as per the documentation that I found in docs/Components/Command-line-interface.md).

[Desktop Entry]
Name=MozillaVPN
Version=1.5
Exec=/usr/bin/mozillavpn ui -m -s
Comment=A fast, secure and easy to use VPN. Built by the makers of Firefox.
Type=Application
Icon=org.mozilla.vpn
OnlyShowIn=GNOME;Unity;MATE;
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Notify=true

Interestingly, when I run it directly from the Startup Applications app, it does minimize to the tray. When I then run it a second time, it opens the client window. I think that somehow the app is being run more than once, but nothing else seems to be. I don't see a duplicate .desktop file in ~/.config/autostart that might explain it.

data-sync-user commented 2 months ago

➤ Naomi Kirby commented:

Regarding the version number in the desktop entry file, that is actually refering to the version of the XDG Desktop Entry specification to which the file has been written. It’s not related to the client software version.

mdpenguin commented 2 months ago

Regarding the version number in the desktop entry file, that is actually refering to the version of the XDG Desktop Entry specification to which the file has been written. It’s not related to the client software version.

Yeah, I figured that out when I read the standard and that's why I deleted the comment. I don't think that gets passed on to whatever system you're seeing that the comments on GitHub are syncing with.