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 268f79d54db20a828008acba369977c0c59eb325
Author: [email protected] <[email protected]>
AuthorDate: Thu Apr 23 11:20:01 2026 -0600
refactor(networkmanager): finish addressing PR #125 review feedback
Complete four remaining gaps from raster's inline review:
1. Module integration: whitelist "networkmanager" in e_module.c,
add gadcon client + module entries to standard/tiling e.src configs
at same geom position as connman (module_enabled ensures mutual
exclusivity). Fixes review comment #2197.
2. Size-hint anti-patterns: drop redundant size_hint_min_set calls
on icon (comment #2332-2334), button (comment #2341), and move
genlist evas_object_show after pack_end (comment #2349).
3. Consolidate 4x if(x){free;x=NULL} blocks to E_FREE_FUNC in
enm_popup_del (comment #2329). Use NM_AGENT_IFACE macro for
hardcoded error string in agent reply (comment #2322).
4. D-Bus abstraction: e_nm_system_init(void) now acquires eldbus
connection internally; released in shutdown. Strip all eldbus
references from e_mod_main.c and agent.c. (comment #2362)
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
data/config/standard/e.src | 20 +++++
data/config/tiling/e.src | 20 +++++
src/bin/e_module.c | 1 +
src/modules/networkmanager/e_mod_main.c | 105 +++++++++++++-------------
src/modules/networkmanager/e_networkmanager.c | 14 +++-
src/modules/networkmanager/e_networkmanager.h | 2 +-
6 files changed, 105 insertions(+), 57 deletions(-)
diff --git a/data/config/standard/e.src b/data/config/standard/e.src
index 03f01941a..86a3aefdc 100644
--- a/data/config/standard/e.src
+++ b/data/config/standard/e.src
@@ -887,6 +887,22 @@ group "E_Config" struct {
value "autoscroll" uchar: 0;
value "resizable" uchar: 0;
}
+ group "E_Config_Gadcon_Client" struct {
+ value "name" string: "networkmanager";
+ value "id" string: "networkmanager";
+ value "geom.pos" int: 352;
+ value "geom.size" int: 32;
+ value "geom.res" int: 800;
+ value "geom.pos_x" double: 0.0;
+ value "geom.pos_y" double: 0.0;
+ value "geom.size_w" double: 0.0;
+ value "geom.size_h" double: 0.0;
+ value "state_info.seq" int: 18;
+ value "state_info.flags" int: 0;
+ value "style" string: "plain";
+ value "autoscroll" uchar: 0;
+ value "resizable" uchar: 0;
+ }
}
value "name" string: "shelf";
value "id" int: 1;
@@ -1072,6 +1088,10 @@ group "E_Config" struct {
value "name" string: "connman";
value "enabled" uchar: 1;
}
+ group "E_Config_Module" struct {
+ value "name" string: "networkmanager";
+ value "enabled" uchar: 1;
+ }
group "E_Config_Module" struct {
value "name" string: "bluez5";
value "enabled" uchar: 1;
diff --git a/data/config/tiling/e.src b/data/config/tiling/e.src
index fa6510c8f..a79afb19f 100644
--- a/data/config/tiling/e.src
+++ b/data/config/tiling/e.src
@@ -904,6 +904,22 @@ group "E_Config" struct {
value "autoscroll" uchar: 0;
value "resizable" uchar: 0;
}
+ group "E_Config_Gadcon_Client" struct {
+ value "name" string: "networkmanager";
+ value "id" string: "networkmanager";
+ value "geom.pos" int: 352;
+ value "geom.size" int: 32;
+ value "geom.res" int: 800;
+ value "geom.pos_x" double: 0.0;
+ value "geom.pos_y" double: 0.0;
+ value "geom.size_w" double: 0.0;
+ value "geom.size_h" double: 0.0;
+ value "state_info.seq" int: 19;
+ value "state_info.flags" int: 0;
+ value "style" string: "plain";
+ value "autoscroll" uchar: 0;
+ value "resizable" uchar: 0;
+ }
}
value "name" string: "shelf";
value "id" int: 1;
@@ -1089,6 +1105,10 @@ group "E_Config" struct {
value "name" string: "connman";
value "enabled" uchar: 1;
}
+ group "E_Config_Module" struct {
+ value "name" string: "networkmanager";
+ value "enabled" uchar: 1;
+ }
group "E_Config_Module" struct {
value "name" string: "bluez5";
value "enabled" uchar: 1;
diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index 7f9d5e201..39399c08e 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -755,6 +755,7 @@ _e_module_whitelist_check(void)
"luncher",
"mixer",
"msgbus",
+ "networkmanager",
"notification",
"ofono",
"pager",
diff --git a/src/modules/networkmanager/e_mod_main.c b/src/modules/networkmanager/e_mod_main.c
index 768c4ed4c..d9e8896bb 100644
--- a/src/modules/networkmanager/e_mod_main.c
+++ b/src/modules/networkmanager/e_mod_main.c
@@ -49,27 +49,10 @@ enm_popup_del(E_NM_Instance *inst)
E_FREE_FUNC(inst->popup, e_object_del);
E_FREE_FUNC(inst->ctxt->popup_update_timer, ecore_timer_del);
inst->ui.popup.genlist = inst->ui.popup.ip_label = NULL;
- /* Item classes are freed with the popup — clear pointers so update guard works */
- if (inst->ui.popup.itc_group)
- {
- elm_genlist_item_class_free(inst->ui.popup.itc_group);
- inst->ui.popup.itc_group = NULL;
- }
- if (inst->ui.popup.itc_group_wifi)
- {
- elm_genlist_item_class_free(inst->ui.popup.itc_group_wifi);
- inst->ui.popup.itc_group_wifi = NULL;
- }
- if (inst->ui.popup.itc_ap)
- {
- elm_genlist_item_class_free(inst->ui.popup.itc_ap);
- inst->ui.popup.itc_ap = NULL;
- }
- if (inst->ui.popup.itc_eth)
- {
- elm_genlist_item_class_free(inst->ui.popup.itc_eth);
- inst->ui.popup.itc_eth = NULL;
- }
+ E_FREE_FUNC(inst->ui.popup.itc_group, elm_genlist_item_class_free);
+ E_FREE_FUNC(inst->ui.popup.itc_group_wifi, elm_genlist_item_class_free);
+ E_FREE_FUNC(inst->ui.popup.itc_ap, elm_genlist_item_class_free);
+ E_FREE_FUNC(inst->ui.popup.itc_eth, elm_genlist_item_class_free);
}
static void
@@ -150,18 +133,21 @@ _enm_itc_ap_content_get(void *data, Evas_Object *obj, const char *part)
{
Evas_Object *ic, *tbl, *rect;
- ic = _enm_ap_icon_new(id->nm, id->ap, evas_object_evas_get(obj));
- if (!ic) return NULL;
- evas_object_size_hint_min_set(ic, ELM_SCALE_SIZE(32), ELM_SCALE_SIZE(32));
- evas_object_show(ic);
-
tbl = elm_table_add(obj);
+
+ ic = _enm_ap_icon_new(id->nm, id->ap, evas_object_evas_get(obj));
+ if (!ic)
+ {
+ evas_object_del(tbl);
+ return NULL;
+ }
+ evas_object_show(ic);
elm_table_pack(tbl, ic, 0, 0, 1, 1);
rect = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(rect, 0, 0, 0, 0);
- evas_object_size_hint_min_set(rect, ELM_SCALE_SIZE(32), ELM_SCALE_SIZE(32));
- evas_object_show(rect);
+ evas_object_size_hint_min_set(rect, ELM_SCALE_SIZE(32),
+ ELM_SCALE_SIZE(32));
elm_table_pack(tbl, rect, 0, 0, 1, 1);
return tbl;
@@ -195,18 +181,21 @@ _enm_itc_eth_content_get(void *data, Evas_Object *obj, const char *part)
{
Evas_Object *ic, *tbl, *rect;
- ic = _enm_eth_icon_new(id->dev, evas_object_evas_get(obj));
- if (!ic) return NULL;
- evas_object_size_hint_min_set(ic, ELM_SCALE_SIZE(32), ELM_SCALE_SIZE(32));
- evas_object_show(ic);
-
tbl = elm_table_add(obj);
+
+ ic = _enm_eth_icon_new(id->dev, evas_object_evas_get(obj));
+ if (!ic)
+ {
+ evas_object_del(tbl);
+ return NULL;
+ }
+ evas_object_show(ic);
elm_table_pack(tbl, ic, 0, 0, 1, 1);
rect = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(rect, 0, 0, 0, 0);
- evas_object_size_hint_min_set(rect, ELM_SCALE_SIZE(32), ELM_SCALE_SIZE(32));
- evas_object_show(rect);
+ evas_object_size_hint_min_set(rect, ELM_SCALE_SIZE(32),
+ ELM_SCALE_SIZE(32));
elm_table_pack(tbl, rect, 0, 0, 1, 1);
return tbl;
@@ -492,7 +481,6 @@ _enm_ap_end_new(struct NM_Manager *nm, struct NM_Access_Point *ap,
evas_object_smart_callback_add(end, "clicked", _enm_forget_click_cb, fd);
evas_object_event_callback_add(end, EVAS_CALLBACK_DEL,
_enm_forget_data_free_cb, fd);
- evas_object_size_hint_min_set(end, ELM_SCALE_SIZE(32), ELM_SCALE_SIZE(32));
return end;
}
@@ -748,12 +736,16 @@ _enm_popup_update(struct NM_Manager *nm, E_NM_Instance *inst)
}
-static void
-_enm_widget_size_set(E_NM_Instance *inst, Evas_Object *widget,
- Evas_Coord percent_w, Evas_Coord percent_h,
- Evas_Coord min_w, Evas_Coord min_h,
- Evas_Coord max_w, Evas_Coord max_h)
+/* Wrap content in an elm_table with a transparent sizer rect so the whole
+ * assembly has a floor of w x h (zone-relative, clamped by min/max) without
+ * fighting the content's own min-size calculation. */
+static Evas_Object *
+_enm_widget_size_wrap(E_NM_Instance *inst, Evas_Object *content,
+ Evas_Coord percent_w, Evas_Coord percent_h,
+ Evas_Coord min_w, Evas_Coord min_h,
+ Evas_Coord max_w, Evas_Coord max_h)
{
+ Evas_Object *tbl, *rect;
Evas_Coord w, h, zw, zh;
E_Zone *zone;
@@ -773,7 +765,16 @@ _enm_widget_size_set(E_NM_Instance *inst, Evas_Object *widget,
if (h < min_h) h = min_h;
else if (h > max_h) h = max_h;
- evas_object_size_hint_min_set(widget, w, h);
+ tbl = elm_table_add(e_comp->elm);
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(content));
+ evas_object_color_set(rect, 0, 0, 0, 0);
+ evas_object_size_hint_min_set(rect, w, h);
+ elm_table_pack(tbl, rect, 0, 0, 1, 1);
+
+ elm_table_pack(tbl, content, 0, 0, 1, 1);
+
+ return tbl;
}
static void
@@ -801,7 +802,6 @@ _enm_popup_new(E_NM_Instance *inst)
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_scroller_bounce_set(gl, EINA_FALSE, EINA_TRUE);
- evas_object_show(gl);
inst->ui.popup.genlist = gl;
/* Item classes — created per-popup, freed in enm_popup_del */
@@ -842,6 +842,7 @@ _enm_popup_new(E_NM_Instance *inst)
inst);
elm_box_pack_end(box, gl);
+ evas_object_show(gl);
/* IP address label */
inst->ui.popup.ip_label = elm_label_add(box);
@@ -857,8 +858,14 @@ _enm_popup_new(E_NM_Instance *inst)
_enm_popup_update(ctxt->nm, inst);
- _enm_widget_size_set(inst, box, 10, 30, 192, 240, 360, 400);
- e_gadcon_popup_content_set(inst->popup, box);
+ {
+ Evas_Object *wrapper = _enm_widget_size_wrap(inst, box,
+ 10, 30,
+ 192, 240,
+ 360, 400);
+ evas_object_show(wrapper);
+ e_gadcon_popup_content_set(inst->popup, wrapper);
+ }
e_comp_object_util_autoclose(inst->popup->comp_object, _enm_popup_del,
NULL, inst);
e_gadcon_popup_show(inst->popup);
@@ -1599,7 +1606,6 @@ E_API void *
e_modapi_init(E_Module *m)
{
E_NM_Module_Context *ctxt;
- Eldbus_Connection *c;
if (_e_nm_log_dom < 0)
{
@@ -1615,13 +1621,10 @@ e_modapi_init(E_Module *m)
ctxt = E_NEW(E_NM_Module_Context, 1);
if (!ctxt) goto error_nm_context;
- c = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
- if (!c) goto error_dbus_bus_get;
-
e_nm_module_callbacks_set(&_enm_mod_cbs);
enm_agent_ui_register();
- if (!e_nm_system_init(c)) goto error_nm_system_init;
+ if (!e_nm_system_init()) goto error_nm_system_init;
ctxt->conf_dialog = NULL;
networkmanager_mod = m;
@@ -1639,8 +1642,6 @@ e_modapi_init(E_Module *m)
return ctxt;
error_nm_system_init:
- eldbus_connection_unref(c);
-error_dbus_bus_get:
E_FREE(ctxt);
error_nm_context:
eina_log_domain_unregister(_e_nm_log_dom);
diff --git a/src/modules/networkmanager/e_networkmanager.c b/src/modules/networkmanager/e_networkmanager.c
index 8589d8e2f..8eb190d8d 100644
--- a/src/modules/networkmanager/e_networkmanager.c
+++ b/src/modules/networkmanager/e_networkmanager.c
@@ -2203,7 +2203,7 @@ e_nm_agent_reply_cancel(E_NM_Agent_Request *req)
if (!req->msg) { _agent_request_free(req); return; }
reply = eldbus_message_error_new(req->msg,
- "org.freedesktop.NetworkManager.SecretAgent.UserCanceled",
+ NM_AGENT_IFACE ".UserCanceled",
"User canceled password dialog");
eldbus_connection_send(req->agent->eldbus_conn, reply, NULL, NULL, -1);
@@ -2418,19 +2418,25 @@ _e_nm_agent_del(E_NM_Agent *a)
/* -------------------------------------------------------------------------- */
unsigned int
-e_nm_system_init(Eldbus_Connection *eldbus_conn)
+e_nm_system_init(void)
{
init_count++;
if (init_count > 1) return init_count;
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
+ if (!conn)
+ {
+ init_count--;
+ return 0;
+ }
+
E_NM_EVENT_MANAGER_IN = ecore_event_type_new();
E_NM_EVENT_MANAGER_OUT = ecore_event_type_new();
- conn = eldbus_conn;
eldbus_name_owner_changed_callback_add(conn, NM_BUS_NAME,
_e_nm_system_name_owner_changed,
NULL, EINA_TRUE);
- agent = _e_nm_agent_new(eldbus_conn);
+ agent = _e_nm_agent_new(conn);
suspend_handler = ecore_event_handler_add(E_EVENT_SYS_SUSPEND,
_e_nm_sys_suspend_cb, NULL);
diff --git a/src/modules/networkmanager/e_networkmanager.h b/src/modules/networkmanager/e_networkmanager.h
index e7cfc05f0..c98d68c3e 100644
--- a/src/modules/networkmanager/e_networkmanager.h
+++ b/src/modules/networkmanager/e_networkmanager.h
@@ -197,7 +197,7 @@ extern int E_NM_EVENT_MANAGER_IN;
extern int E_NM_EVENT_MANAGER_OUT;
/* Lifecycle */
-unsigned int e_nm_system_init(Eldbus_Connection *eldbus_conn) EINA_ARG_NONNULL(1);
+unsigned int e_nm_system_init(void);
unsigned int e_nm_system_shutdown(void);
/* Scan */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.