This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository enlightenment.
View the commit online.
commit d3a16adad663e9facaed543052ab13729e2e29d0
Author: [email protected] <[email protected]>
AuthorDate: Sat Mar 7 11:40:40 2026 -0700
feat: show ethernet devices in NetworkManager popup and gadget icon
Parse ActiveConnection Type property to detect ethernet vs wifi
connections. The gadget icon now switches between ethernet plug and
wifi bars based on the primary connection type, matching ConnMan
behavior.
Connected ethernet devices appear at the top of the popup list with
the interface name (e.g. "enp1s0") and an ethernet icon using the
ConnMan theme's icon/ethernet group.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
src/modules/networkmanager/e_mod_main.c | 56 +++++++++++++++++++++++++--
src/modules/networkmanager/e_networkmanager.c | 24 +++++++++++-
src/modules/networkmanager/e_networkmanager.h | 1 +
3 files changed, 77 insertions(+), 4 deletions(-)
diff --git a/src/modules/networkmanager/e_mod_main.c b/src/modules/networkmanager/e_mod_main.c
index 3cc958f4b..5d9e31d5b 100644
--- a/src/modules/networkmanager/e_mod_main.c
+++ b/src/modules/networkmanager/e_mod_main.c
@@ -165,6 +165,35 @@ _enm_ap_end_new(struct NM_Access_Point *ap, Evas *evas)
return end;
}
+static Evas_Object *
+_enm_eth_icon_new(struct NM_Device *dev, Evas *evas)
+{
+ Edje_Message_Int_Set *msg;
+ Evas_Object *icon;
+ int state_val;
+
+ icon = edje_object_add(evas);
+ if (!e_theme_edje_object_set(icon, "base/theme/modules/networkmanager",
+ "e/modules/networkmanager/icon/ethernet"))
+ e_theme_edje_object_set(icon, "base/theme/modules/connman",
+ "e/modules/connman/icon/ethernet");
+
+ /* NM device state 100 = activated → ONLINE(5), otherwise IDLE(1) */
+ state_val = (dev->state >= 100) ? 5 : 1;
+
+ msg = malloc(sizeof(*msg) + sizeof(int));
+ if (msg)
+ {
+ msg->count = 2;
+ msg->val[0] = state_val;
+ msg->val[1] = 100; /* ethernet has no signal strength concept */
+ edje_object_message_send(icon, EDJE_MESSAGE_INT_SET, 1, msg);
+ free(msg);
+ }
+
+ return icon;
+}
+
/* Find the best AP for a given SSID across all devices.
* Prefers the active AP if it matches, otherwise picks highest strength.
* Used to deduplicate multiple stations broadcasting the same network name. */
@@ -218,10 +247,23 @@ _enm_popup_update(struct NM_Manager *nm, E_NM_Instance *inst)
e_widget_ilist_freeze(list);
e_widget_ilist_clear(list);
+ /* Show connected ethernet devices first */
+ EINA_INLIST_FOREACH(nm->devices, dev)
+ {
+ Evas_Object *icon;
+
+ if (dev->type != NM_DEVICE_TYPE_ETHERNET) continue;
+ if (dev->state < 100) continue; /* not activated */
+
+ icon = _enm_eth_icon_new(dev, evas);
+ e_widget_ilist_append_full(list, icon, NULL,
+ dev->interface ?: _("Wired"),
+ NULL, NULL, NULL);
+ }
+
/* Deduplicate APs by SSID — show only the strongest station per SSID */
seen_ssids = eina_hash_string_superfast_new(NULL);
-
EINA_INLIST_FOREACH(nm->devices, dev)
{
struct NM_Access_Point *ap;
@@ -408,16 +450,24 @@ _enm_mod_manager_update_inst(E_NM_Module_Context *ctxt EINA_UNUSED,
Evas_Object *o = inst->ui.gadget;
Edje_Message_Int_Set *msg;
struct NM_Access_Point *active_ap = NULL;
- const char *typestr = "wifi";
+ const char *typestr;
char buf[256];
uint8_t strength;
int theme_state;
+ /* Determine connection technology type for gadget icon */
+ typestr = (nm && nm->active_conn_type == NM_DEVICE_TYPE_ETHERNET)
+ ? "ethernet" : "wifi";
+
/* Resolve active AP for real signal strength */
if (nm && nm->active_ap_path)
active_ap = enm_manager_find_ap(nm, nm->active_ap_path);
- strength = active_ap ? active_ap->strength : 0;
+ /* Ethernet: full strength; WiFi: from active AP */
+ if (nm && nm->active_conn_type == NM_DEVICE_TYPE_ETHERNET)
+ strength = 100;
+ else
+ strength = active_ap ? active_ap->strength : 0;
theme_state = _enm_state_to_connman(state);
msg = malloc(sizeof(*msg) + sizeof(int));
diff --git a/src/modules/networkmanager/e_networkmanager.c b/src/modules/networkmanager/e_networkmanager.c
index 4a6bc5dc7..1279314fd 100644
--- a/src/modules/networkmanager/e_networkmanager.c
+++ b/src/modules/networkmanager/e_networkmanager.c
@@ -668,6 +668,17 @@ _manager_watch_ip4(struct NM_Manager *nm, const char *ip4config_path)
/* Active connection tracking (persistent watcher) */
/* -------------------------------------------------------------------------- */
+static enum NM_Device_Type
+_nm_conn_type_parse(const char *type)
+{
+ if (!type) return NM_DEVICE_TYPE_UNKNOWN;
+ if (!strcmp(type, "802-3-ethernet")) return NM_DEVICE_TYPE_ETHERNET;
+ if (!strcmp(type, "802-11-wireless")) return NM_DEVICE_TYPE_WIFI;
+ if (!strcmp(type, "bluetooth")) return NM_DEVICE_TYPE_BLUETOOTH;
+ if (!strcmp(type, "gsm") || !strcmp(type, "cdma")) return NM_DEVICE_TYPE_MODEM;
+ return NM_DEVICE_TYPE_UNKNOWN;
+}
+
static void
_manager_active_conn_watch_free(struct NM_Manager *nm)
{
@@ -770,10 +781,20 @@ _active_conn_get_props_cb(void *data, const Eldbus_Message *msg,
nm->active_ap_path = eina_stringshare_add(ap_path);
}
}
+ else if (!strcmp(key, "Type"))
+ {
+ const char *type;
+ if (eldbus_message_iter_arguments_get(var, "s", &type))
+ {
+ nm->active_conn_type = _nm_conn_type_parse(type);
+ DBG("ActiveConn Type=%s -> %d", type, nm->active_conn_type);
+ }
+ }
}
/* Proxy stays alive — updates arrive via _active_conn_prop_changed */
- DBG("ActiveConn done: active_ap=%s", nm->active_ap_path ?: "(null)");
+ DBG("ActiveConn done: type=%d active_ap=%s",
+ nm->active_conn_type, nm->active_ap_path ?: "(null)");
enm_mod_manager_update(nm);
enm_mod_aps_changed(nm);
}
@@ -884,6 +905,7 @@ _manager_prop_changed(void *data, const Eldbus_Message *msg)
nm->active_connection_path = NULL;
free(nm->ip_address);
nm->ip_address = NULL;
+ nm->active_conn_type = NM_DEVICE_TYPE_UNKNOWN;
enm_mod_manager_update(nm);
}
}
diff --git a/src/modules/networkmanager/e_networkmanager.h b/src/modules/networkmanager/e_networkmanager.h
index 1f8e6ac90..22336f060 100644
--- a/src/modules/networkmanager/e_networkmanager.h
+++ b/src/modules/networkmanager/e_networkmanager.h
@@ -98,6 +98,7 @@ struct NM_Manager
const char *active_ap_path;
const char *active_connection_path;
char *ip_address;
+ enum NM_Device_Type active_conn_type; /* type of the primary active connection */
struct
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.