aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-05-27 19:48:48 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-05-27 19:48:48 +0900
commit060e62061d030d0e3b69b315efb11e61baa6c064 (patch)
tree95d55a5947eaefce20108398ead030916b0af76a /src/lib/elementary/efl_ui_win.c
parenteet - check for null edd's and don't decode junk data (diff)
downloadefl-060e62061d030d0e3b69b315efb11e61baa6c064.tar.gz
efl ui win - fix legacy theme support correctly
this fixes https://phab.enlightenment.org/T6918. during development legacy theme support was b roken. 473e657120ffd9626b6ee8832c75f2f66c9a5351 broke it.
Diffstat (limited to 'src/lib/elementary/efl_ui_win.c')
-rw-r--r--src/lib/elementary/efl_ui_win.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 68be870738..f0f0dd211c 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4349,6 +4349,30 @@ _elm_object_part_cursor_set(Evas_Object *obj, Evas_Object *edj,
elm_object_sub_cursor_set(sub, obj, cursor);
}
+static char *
+_efl_system_theme_path_get(void)
+{
+ // Find the default theme from EFL install. Quite ugly.
+ const char *sysdir;
+ char *version;
+ char path[PATH_MAX];
+ int v;
+
+ sysdir = elm_theme_system_dir_get();
+ if (!sysdir) return NULL;
+
+ eina_file_path_join(path, PATH_MAX, sysdir, "default.edj");
+ version = edje_file_data_get(path, "version");
+ v = version ? atoi(version) : 0;
+ free(version);
+ if (v < FRAME_OBJ_THEME_MIN_VERSION)
+ {
+ ERR("Default system theme is too old, something is wrong with your installation of EFL.");
+ return NULL;
+ }
+ return strdup(path);
+}
+
static void
_elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
{
@@ -4380,16 +4404,23 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
if (v < FRAME_OBJ_THEME_MIN_VERSION)
{
+ // Theme compatibility
+ const char *key = "elm/border/base/default"; // FIXME?
+ char *sys_theme;
+
WRN("Selected theme does not support the required border theme API "
"(version = %d, requires >= %d).",
v, FRAME_OBJ_THEME_MIN_VERSION);
-
- if (!elm_widget_theme_object_set(sd->obj, sd->frame_obj, "border", element, style))
+ sys_theme = _efl_system_theme_path_get();
+ if (!sys_theme ||
+ !edje_object_file_set(sd->frame_obj, sys_theme, key))
{
ERR("Failed to set main border theme for the window.");
ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
+ free(sys_theme);
return;
}
+ free(sys_theme);
}
edje_object_freeze(sd->frame_obj);