forked from enlightenment/enlightenment
fix crashing when shelf config dialog is open and orientation is changed using a menu and then shelf config is changed and applied from the config dialog
SVN revision: 76376
This commit is contained in:
parent
60e1c09cc4
commit
3eb3b755ea
|
@ -15,6 +15,7 @@ struct _E_Config_Dialog_Data
|
||||||
int autohide, autohide_action;
|
int autohide, autohide_action;
|
||||||
double hide_timeout, hide_duration;
|
double hide_timeout, hide_duration;
|
||||||
int desk_show_mode;
|
int desk_show_mode;
|
||||||
|
Eina_List *handlers;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
@ -47,6 +48,22 @@ e_int_shelf_config(E_Shelf *es)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
|
static Eina_Bool
|
||||||
|
_shelf_event_add(E_Config_Dialog_Data *cfdata, int type __UNUSED__, E_Event_Shelf *ev)
|
||||||
|
{
|
||||||
|
if (ev->shelf->cfg == cfdata->escfg)
|
||||||
|
cfdata->es = ev->shelf;
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_shelf_event_del(E_Config_Dialog_Data *cfdata, int type __UNUSED__, E_Event_Shelf *ev)
|
||||||
|
{
|
||||||
|
if (ev->shelf == cfdata->es)
|
||||||
|
cfdata->es = NULL;
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
_create_data(E_Config_Dialog *cfd)
|
_create_data(E_Config_Dialog *cfd)
|
||||||
{
|
{
|
||||||
|
@ -55,6 +72,8 @@ _create_data(E_Config_Dialog *cfd)
|
||||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||||
cfdata->es = cfd->data;
|
cfdata->es = cfd->data;
|
||||||
cfdata->escfg = cfdata->es->cfg;
|
cfdata->escfg = cfdata->es->cfg;
|
||||||
|
E_LIST_HANDLERS_APPEND(cfdata->handlers, E_EVENT_SHELF_ADD, _shelf_event_add, cfdata);
|
||||||
|
E_LIST_HANDLERS_APPEND(cfdata->handlers, E_EVENT_SHELF_DEL, _shelf_event_del, cfdata);
|
||||||
_fill_data(cfdata);
|
_fill_data(cfdata);
|
||||||
return cfdata;
|
return cfdata;
|
||||||
}
|
}
|
||||||
|
@ -102,9 +121,10 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
eina_list_free(cfdata->autohide_list);
|
eina_list_free(cfdata->autohide_list);
|
||||||
|
|
||||||
if (cfdata->style) eina_stringshare_del(cfdata->style);
|
eina_stringshare_del(cfdata->style);
|
||||||
cfdata->style = NULL;
|
cfdata->style = NULL;
|
||||||
|
|
||||||
|
E_FREE_LIST(cfdata->handlers, ecore_event_handler_del);
|
||||||
cfdata->es->config_dialog = NULL;
|
cfdata->es->config_dialog = NULL;
|
||||||
E_FREE(cfdata);
|
E_FREE(cfdata);
|
||||||
}
|
}
|
||||||
|
@ -272,8 +292,6 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
if (cfdata->escfg->orient != cfdata->orient)
|
if (cfdata->escfg->orient != cfdata->orient)
|
||||||
{
|
{
|
||||||
cfdata->escfg->orient = cfdata->orient;
|
cfdata->escfg->orient = cfdata->orient;
|
||||||
e_shelf_orient(cfdata->es, cfdata->orient);
|
|
||||||
e_shelf_position_calc(cfdata->es);
|
|
||||||
recreate = 1;
|
recreate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue