Sysinfo gadgets: Prevent info popup from getting stuck.

This commit is contained in:
Stephen 'Okra' Houston 2017-02-10 11:37:30 -06:00
parent 762879bf5c
commit 327f9bc68f
4 changed files with 7 additions and 30 deletions

View File

@ -89,7 +89,6 @@ _batman_popup_create(Instance *inst)
frame = elm_frame_add(popup);
E_EXPAND(frame); E_FILL(frame);
printf("%d\n", inst->cfg->batman.full);
if (inst->cfg->batman.have_power && (inst->cfg->batman.full < 99))
elm_object_text_set(frame, _("Battery Charging"));
else if (inst->cfg->batman.full >= 99)
@ -144,22 +143,14 @@ _batman_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
if (ev->button != 3)
{
if (inst->cfg->batman.popup)
{
elm_ctxpopup_dismiss(inst->cfg->batman.popup);
inst->cfg->batman.popup = NULL;
}
elm_ctxpopup_dismiss(inst->cfg->batman.popup);
else
{
inst->cfg->batman.popup = _batman_popup_create(inst);
}
inst->cfg->batman.popup = _batman_popup_create(inst);
}
else
{
if (inst->cfg->batman.popup)
{
elm_ctxpopup_dismiss(inst->cfg->batman.popup);
inst->cfg->batman.popup = NULL;
}
elm_ctxpopup_dismiss(inst->cfg->batman.popup);
if (!sysinfo_config) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (inst->cfg->esm != E_SYSINFO_MODULE_BATMAN)

View File

@ -74,7 +74,6 @@ _cpumonitor_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
if (inst->cfg->cpumonitor.popup)
{
elm_ctxpopup_dismiss(inst->cfg->cpumonitor.popup);
inst->cfg->cpumonitor.popup = NULL;
return;
}
popup = elm_ctxpopup_add(e_comp->elm);
@ -106,10 +105,7 @@ _cpumonitor_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
else
{
if (inst->cfg->cpumonitor.popup)
{
elm_ctxpopup_dismiss(inst->cfg->cpumonitor.popup);
inst->cfg->cpumonitor.popup = NULL;
}
elm_ctxpopup_dismiss(inst->cfg->cpumonitor.popup);
if (!sysinfo_config) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (inst->cfg->esm != E_SYSINFO_MODULE_CPUMONITOR)

View File

@ -239,10 +239,7 @@ _memusage_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
if (ev->button != 3)
{
if (inst->cfg->memusage.popup)
{
elm_ctxpopup_dismiss(inst->cfg->memusage.popup);
inst->cfg->memusage.popup = NULL;
}
elm_ctxpopup_dismiss(inst->cfg->memusage.popup);
else
{
inst->cfg->memusage.popup = _memusage_popup_create(inst);
@ -252,10 +249,7 @@ _memusage_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
else
{
if (inst->cfg->memusage.popup)
{
elm_ctxpopup_dismiss(inst->cfg->memusage.popup);
inst->cfg->memusage.popup = NULL;
}
elm_ctxpopup_dismiss(inst->cfg->memusage.popup);
if (!sysinfo_config) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (inst->cfg->esm != E_SYSINFO_MODULE_MEMUSAGE)

View File

@ -75,7 +75,6 @@ _netstatus_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
if (inst->cfg->netstatus.popup)
{
elm_ctxpopup_dismiss(inst->cfg->netstatus.popup);
inst->cfg->netstatus.popup = NULL;
return;
}
popup = elm_ctxpopup_add(e_comp->elm);
@ -99,10 +98,7 @@ _netstatus_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
else
{
if (inst->cfg->netstatus.popup)
{
elm_ctxpopup_dismiss(inst->cfg->netstatus.popup);
inst->cfg->netstatus.popup = NULL;
}
elm_ctxpopup_dismiss(inst->cfg->netstatus.popup);
if (!sysinfo_config) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (inst->cfg->esm != E_SYSINFO_MODULE_NETSTATUS)