forked from enlightenment/efl
ee engines should not crash when re-setting the same title/name_class
@fix
This commit is contained in:
parent
02594a2519
commit
6a934f703c
|
@ -325,6 +325,7 @@ _ecore_evas_title_set(Ecore_Evas *ee, const char *title)
|
||||||
{
|
{
|
||||||
INF("ecore evas title set");
|
INF("ecore evas title set");
|
||||||
|
|
||||||
|
if (eina_streq(ee->prop.title, title)) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (title) ee->prop.title = strdup(title);
|
if (title) ee->prop.title = strdup(title);
|
||||||
|
|
|
@ -692,6 +692,7 @@ _ecore_evas_drm_hide(Ecore_Evas *ee)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_drm_title_set(Ecore_Evas *ee, const char *title)
|
_ecore_evas_drm_title_set(Ecore_Evas *ee, const char *title)
|
||||||
{
|
{
|
||||||
|
if (eina_streq(ee->prop.title, title)) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (title) ee->prop.title = strdup(title);
|
if (title) ee->prop.title = strdup(title);
|
||||||
|
@ -700,12 +701,18 @@ _ecore_evas_drm_title_set(Ecore_Evas *ee, const char *title)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_drm_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
|
_ecore_evas_drm_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
|
||||||
{
|
{
|
||||||
if (ee->prop.name) free(ee->prop.name);
|
if (!eina_streq(ee->prop.name, n))
|
||||||
if (ee->prop.clas) free(ee->prop.clas);
|
{
|
||||||
ee->prop.name = NULL;
|
if (ee->prop.name) free(ee->prop.name);
|
||||||
ee->prop.clas = NULL;
|
ee->prop.name = NULL;
|
||||||
if (n) ee->prop.name = strdup(n);
|
if (n) ee->prop.name = strdup(n);
|
||||||
if (c) ee->prop.clas = strdup(c);
|
}
|
||||||
|
if (!eina_streq(ee->prop.clas, c))
|
||||||
|
{
|
||||||
|
if (ee->prop.clas) free(ee->prop.clas);
|
||||||
|
ee->prop.clas = NULL;
|
||||||
|
if (c) ee->prop.clas = strdup(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1098,6 +1098,7 @@ _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
|
if (eina_streq(ee->prop.title, title)) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (title) ee->prop.title = strdup(title);
|
if (title) ee->prop.title = strdup(title);
|
||||||
|
@ -1123,13 +1124,18 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
wdata = ee->engine.data;
|
wdata = ee->engine.data;
|
||||||
if (ee->prop.name) free(ee->prop.name);
|
if (!eina_streq(ee->prop.name, n))
|
||||||
if (ee->prop.clas) free(ee->prop.clas);
|
{
|
||||||
ee->prop.name = NULL;
|
if (ee->prop.name) free(ee->prop.name);
|
||||||
ee->prop.clas = NULL;
|
ee->prop.name = NULL;
|
||||||
if (n) ee->prop.name = strdup(n);
|
if (n) ee->prop.name = strdup(n);
|
||||||
if (c) ee->prop.clas = strdup(c);
|
}
|
||||||
|
if (!eina_streq(ee->prop.clas, c))
|
||||||
|
{
|
||||||
|
if (ee->prop.clas) free(ee->prop.clas);
|
||||||
|
ee->prop.clas = NULL;
|
||||||
|
if (c) ee->prop.clas = strdup(c);
|
||||||
|
}
|
||||||
if (ee->prop.clas)
|
if (ee->prop.clas)
|
||||||
ecore_wl_window_class_name_set(wdata->win, ee->prop.clas);
|
ecore_wl_window_class_name_set(wdata->win, ee->prop.clas);
|
||||||
}
|
}
|
||||||
|
|
|
@ -757,7 +757,7 @@ static void
|
||||||
_ecore_evas_win32_title_set(Ecore_Evas *ee, const char *title)
|
_ecore_evas_win32_title_set(Ecore_Evas *ee, const char *title)
|
||||||
{
|
{
|
||||||
INF("ecore evas title set");
|
INF("ecore evas title set");
|
||||||
|
if (eina_streq(ee->prop.title, title)) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (title) ee->prop.title = strdup(title);
|
if (title) ee->prop.title = strdup(title);
|
||||||
|
|
|
@ -2898,6 +2898,7 @@ _ecore_evas_x_activate(Ecore_Evas *ee)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_x_title_set(Ecore_Evas *ee, const char *t)
|
_ecore_evas_x_title_set(Ecore_Evas *ee, const char *t)
|
||||||
{
|
{
|
||||||
|
if (eina_streq(ee->prop.title, t)) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (!t) return;
|
if (!t) return;
|
||||||
|
|
Loading…
Reference in New Issue