This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository enlightenment-module-forecasts.
View the commit online.
commit 1ec7ba14ae63e40b24611d24c68bd3cf69f8e037
Author: Alastair Poole <[email protected]>
AuthorDate: Sun May 24 21:48:58 2026 +0100
weather: Fix intermittent gadget menu and popup handling
Ensure swallowed weather icon objects pass mouse events through so right-clicks reach the gadget reliably.
Track popup deletion via the gadcon popup lifecycle, avoid stale popup pointers, and keep an open popup
visible across forecast refreshes instead of closing it unexpectedly.
---
src/e_mod_main.c | 57 ++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 43 insertions(+), 14 deletions(-)
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index 5955b80..936a5aa 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -132,9 +132,11 @@ static void _forecasts_convert_distances(int *value, int dir);
static void _forecasts_convert_pressures(float *value, int dir);
static void _forecasts_display_set(Instance *inst, int ok);
static void _forecasts_popup_content_create(Instance *inst);
+static void _forecasts_popup_show(Instance *inst);
static void _cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
static Evas_Object *_forecasts_popup_icon_create(Evas *evas, const char *code);
static void _forecasts_popup_destroy(Instance *inst);
+static void _forecasts_popup_del_cb(void *obj);
static Eina_Bool _time_local_get(const char *timezone, time_t t, struct tm *tm_out);
static time_t _time_mktime(const char *timezone, struct tm *tm_in);
static void _location_time_text_get(Instance *inst, char *buf, size_t len,
@@ -236,6 +238,8 @@ _gc_shutdown(E_Gadcon_Client *gcc)
evas_object_event_callback_del(w->forecasts_obj, EVAS_CALLBACK_MOUSE_DOWN,
_forecasts_cb_mouse_down);
+ evas_object_event_callback_del(w->forecasts_obj, EVAS_CALLBACK_MOUSE_UP,
+ _cb_mouse_up);
_forecasts_free(w);
E_FREE(inst);
@@ -300,7 +304,6 @@ _forecasts_cb_mouse_down(void *data, Evas *e EINA_UNUSED,
Instance *inst = data;
Evas_Event_Mouse_Down *ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if ((ev->button == 3) && (!forecasts_config->menu))
{
E_Zone *zone;
@@ -552,6 +555,7 @@ _forecasts_new(Evas *evas)
if (!e_theme_edje_object_set(w->icon_obj, "base/theme/modules/forecasts/icons",
"modules/forecasts/icons/3200"))
edje_object_file_set(w->icon_obj, buf, "modules/forecasts/icons/3200");
+ evas_object_pass_events_set(w->icon_obj, EINA_TRUE);
edje_object_part_swallow(w->forecasts_obj, "icon", w->icon_obj);
return w;
@@ -1371,8 +1375,11 @@ _forecasts_display_set(Instance *inst, int ok EINA_UNUSED)
}
}
- if (inst->popup) _forecasts_popup_destroy(inst);
- inst->popup = NULL;
+ if (inst->popup)
+ {
+ _forecasts_popup_destroy(inst);
+ _forecasts_popup_show(inst);
+ }
}
void
@@ -1400,7 +1407,6 @@ _forecasts_config_updated(Config_Item *ci)
_forecasts_converter(inst);
if (inst->popup) _forecasts_popup_destroy(inst);
- inst->popup = NULL;
snprintf(buf, sizeof(buf), "%d°%c", inst->condition.temp, inst->units.temp);
edje_object_part_text_set(inst->forecasts->forecasts_obj, "e.text.temp", buf);
@@ -1660,6 +1666,22 @@ _forecasts_popup_content_create(Instance *inst)
}
e_gadcon_popup_content_set(inst->popup, bx);
+ e_object_data_set(E_OBJECT(inst->popup), inst);
+ E_OBJECT_DEL_SET(inst->popup, _forecasts_popup_del_cb);
+}
+
+static void
+_forecasts_popup_show(Instance *inst)
+{
+ if (!inst) return;
+
+ if (!inst->popup)
+ _forecasts_popup_content_create(inst);
+ if (!inst->popup) return;
+
+ e_gadcon_popup_show(inst->popup);
+ if (!inst->popup->pinned)
+ e_gadcon_popup_toggle_pinned(inst->popup);
}
static Evas_Object *
@@ -1675,6 +1697,7 @@ _forecasts_popup_icon_create(Evas *evas, const char *code)
snprintf(buf, sizeof(buf), "modules/forecasts/icons/%s", code);
if (!e_theme_edje_object_set(o, "base/theme/modules/forecasts/icons", buf))
edje_object_file_set(o, m, buf);
+ evas_object_pass_events_set(o, EINA_TRUE);
return o;
}
@@ -1683,7 +1706,20 @@ static void
_forecasts_popup_destroy(Instance *inst)
{
if (!inst->popup) return;
- e_object_del(E_OBJECT(inst->popup));
+ E_FREE_FUNC(inst->popup, e_object_del);
+ inst->popup_clock_label = NULL;
+}
+
+static void
+_forecasts_popup_del_cb(void *obj)
+{
+ Instance *inst;
+
+ inst = e_object_data_get(obj);
+ if (!inst) return;
+
+ if (inst->popup == obj)
+ inst->popup = NULL;
inst->popup_clock_label = NULL;
}
@@ -1697,16 +1733,9 @@ _cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
if (ev->button == 1)
{
if (!inst->popup)
- {
- _forecasts_popup_content_create(inst);
- e_gadcon_popup_show(inst->popup);
- e_gadcon_popup_toggle_pinned(inst->popup);
- }
+ _forecasts_popup_show(inst);
else
- {
- _forecasts_popup_destroy(inst);
- inst->popup = NULL;
- }
+ _forecasts_popup_destroy(inst);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.