network@cinnamon.org: don't show the offline icon when online through an unmanaged device - #13924
network@cinnamon.org: don't show the offline icon when online through an unmanaged device#13924Fantu wants to merge 2 commits into
Conversation
… an unmanaged device When the only connectivity comes from a device NetworkManager does not manage - typically an interface configured in /etc/network/interfaces, with the ifupdown plugin set to managed=false, which is the default on Debian - there is no active connection for the applet to describe, so _mainConnection is null and the applet shows the offline icon and a "No connection" tooltip even though the machine is fully online. NetworkManager still reports NM_STATE_CONNECTED_GLOBAL in that situation, so use that as the fallback: when there is no main connection but the global state is CONNECTED_GLOBAL, show the generic wired icon and the "Connected to the network" tooltip that _updateIcon() already uses for connections it cannot classify. Everything else is unchanged, and when the machine really is offline the global state is not CONNECTED_GLOBAL, so the offline icon is still shown. Both strings and both icons are already used elsewhere in the applet, so this adds nothing new to translate. Tested on a Debian sid VM with cinnamon 6.6.9 and NetworkManager 1.58: with enp1s0 configured in /etc/network/interfaces the global state is 70 (CONNECTED_GLOBAL) while the only active connection is the loopback one, which the applet skips; the panel icon changes from offline to wired with the patch applied, and goes back to offline as soon as the interface is brought down. This has been reported on the Debian side since 2013 as https://bugs.debian.org/699773 - GNOME Shell used to carry a Debian patch doing the same thing. Assisted-by: Claude Code:claude-opus-5
|
This has been reported by some users over the years, and I've also seen it a lot with Debian test VMs and the Debian unstable test PC. |
|
I'm not keen on this change, it would be better if we had a un-managed icon for this state. |
|
A different icon would be better, but I don't know how it could be made to be easily recognizable and intuitive enough (It seems difficult to me with these small and minimal style icons). Any ideas? |
Reusing "Connected to the network" said nothing about why the applet has no details to show. Use a tooltip of its own, so that a machine online through a device NetworkManager does not manage is distinguishable from one with an active connection the applet cannot classify. One new string to translate. Assisted-by: Claude Code:claude-opus-5
|
Following up on the icon question I asked above: I went through the whole The nearest one is So a dedicated icon means new artwork in xapp-symbolic-icons, and I am still not sure what the metaphor would be at that size and in that minimal style — which was my worry in the first place. If anyone has an idea for how "connected, but not managed by us" should look, I am happy to be pointed at it. Meanwhile the current behaviour is not just imprecise, it is wrong: a machine that is fully online shows the offline icon and "No connection". That is what the Debian report has been about since 2013. So I have updated the PR to at least make the state distinguishable, with a tooltip of its own instead of the generic one: this._setIcon('xsi-network-wired');
this.set_applet_tooltip(_("Connected through an unmanaged device"));That is one new string to translate. There is also a variant with no new strings at all, reusing two msgids this applet already has — this.set_applet_tooltip(_("Connected to the network") + " (" + _("unmanaged") + ")");I did not pick it because building a sentence out of fragments, with the parentheses hardcoded around it, is awkward for translators and reads worse. But if you would rather avoid the new string, say so and I will switch to it. If an unmanaged icon does get drawn later, swapping it in here is a one-line change. Unrelated to this PR, but I ran into it while looking at the icons: |
The network applet shows the offline icon, and a "No connection" tooltip, whenever
_mainConnectionis null. That also happens on a machine that is perfectly online, when the only connectivity comes from a device NetworkManager does not manage — typically an interface configured in/etc/network/interfaces, with the ifupdown plugin set tomanaged=false, which is the default on Debian. There is no active connection for the applet to describe, so it concludes the machine is offline.NetworkManager still reports
NM_STATE_CONNECTED_GLOBALin that situation, so this uses it as the fallback: when there is no main connection but the global state isCONNECTED_GLOBAL, show the generic wired icon and theConnected to the networktooltip that_updateIcon()already uses for active connections it cannot classify. Everything else is unchanged, and when the machine really is offline the global state is notCONNECTED_GLOBAL, so the offline icon is still shown.Both the icons and both the strings are already used elsewhere in the same function, so there is nothing new to translate.
Testing
Debian sid VM, cinnamon 6.6.9, NetworkManager 1.58.0,
enp1s0configured in/etc/network/interfaceswith[ifupdown] managed=false(Debian default):The only active connection is the loopback one, which
_syncActiveConnections()skips because it has no_section, so_mainConnectionends up null. Inspecting the live applet before the patch:and after it:
Bringing the interface down gives
state=20and the offline icon is shown again, as expected.This has been reported on the Debian side since 2013, https://bugs.debian.org/699773 — GNOME Shell used to carry a Debian-specific patch doing exactly this, which is what that bug asked us to port.