diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 397f66786..2358f34f8 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -2065,9 +2065,9 @@ e_client_idler_before(void) if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FETCH, ec)) continue; /* FETCH is hooked by the compositor to get client hints */ - title = e_client_name_get(ec); + title = e_client_util_name_get(ec); if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue; - if (title != e_client_name_get(ec)) + if (title != e_client_util_name_get(ec)) _e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE); /* PRE_POST_FETCH calls e_remember apply for new client */ if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue; @@ -4457,18 +4457,6 @@ e_client_redirected_set(E_Client *ec, Eina_Bool set) //////////////////////////////////////////// -EAPI Eina_Stringshare * -e_client_name_get(const E_Client *ec) -{ - E_OBJECT_CHECK_RETURN(ec, NULL); - E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, NULL); - if (ec->netwm.name) - return ec->netwm.name; - else if (ec->icccm.title) - return ec->icccm.title; - return NULL; -} - EAPI Eina_Bool e_client_util_is_stacking(const E_Client *ec) { diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 6b9977499..6a409f731 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -798,7 +798,6 @@ EAPI E_Client *e_client_under_pointer_get(E_Desk *desk, E_Client *exclude); EAPI int e_client_pointer_warp_to_center_now(E_Client *ec); EAPI int e_client_pointer_warp_to_center(E_Client *ec); EAPI void e_client_redirected_set(E_Client *ec, Eina_Bool set); -EAPI Eina_Stringshare *e_client_name_get(const E_Client *ec); EAPI Eina_Bool e_client_util_is_stacking(const E_Client *ec); #include "e_client.x" #endif diff --git a/src/bin/e_client.x b/src/bin/e_client.x index bcbe0f14b..ac7a96dfb 100644 --- a/src/bin/e_client.x +++ b/src/bin/e_client.x @@ -121,3 +121,14 @@ e_client_util_shadow_state_get(const E_Client *ec) on = !ec->fullscreen; return on; } + +static inline Eina_Stringshare * +e_client_util_name_get(const E_Client *ec) +{ + if (!ec) return NULL; + if (ec->netwm.name) + return ec->netwm.name; + else if (ec->icccm.title) + return ec->icccm.title; + return NULL; +} diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index dc8ca5974..37525029f 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -679,7 +679,7 @@ _e_comp_x_client_pri_raise(E_Client *ec) // EINA_TRUE, EINA_TRUE); EINA_TRUE, EINA_FALSE); // printf("WIN: pid %i, title %s (HI!!!!!!!!!!!!!!!!!!)\n", -// ec->netwm.pid, e_client_name_get(ec)); +// ec->netwm.pid, e_client_util_name_get(ec)); } static void @@ -692,7 +692,7 @@ _e_comp_x_client_pri_norm(E_Client *ec) // EINA_TRUE, EINA_TRUE); EINA_TRUE, EINA_FALSE); // printf("WIN: pid %i, title %s (NORMAL)\n", -// ec->netwm.pid, e_client_name_get(ec)); +// ec->netwm.pid, e_client_util_name_get(ec)); } static void diff --git a/src/bin/e_deskmirror.c b/src/bin/e_deskmirror.c index d95e59eef..9a1b6c325 100644 --- a/src/bin/e_deskmirror.c +++ b/src/bin/e_deskmirror.c @@ -464,7 +464,7 @@ _mirror_client_new(Mirror *m) evas_object_smart_member_add(mb->frame, o); evas_object_name_set(mb->mirror, "mirror"); edje_object_part_swallow(mb->frame, "e.swallow.client", m->mirror); - edje_object_part_text_set(mb->frame, "e.text.title", e_client_name_get(m->ec)); + edje_object_part_text_set(mb->frame, "e.text.title", e_client_util_name_get(m->ec)); return o; } @@ -782,7 +782,7 @@ e_deskmirror_mirror_copy(Evas_Object *obj) oo = e_comp_object_util_mirror_add(mb->m->comp_object); edje_object_part_swallow(o, "e.swallow.client", oo); - edje_object_part_text_set(o, "e.text.title", e_client_name_get(mb->m->ec)); + edje_object_part_text_set(o, "e.text.title", e_client_util_name_get(mb->m->ec)); e_comp_object_util_del_list_append(o, oo); return o; } diff --git a/src/bin/e_desktop_editor.c b/src/bin/e_desktop_editor.c index b13de3434..62255c7e4 100644 --- a/src/bin/e_desktop_editor.c +++ b/src/bin/e_desktop_editor.c @@ -107,7 +107,7 @@ e_desktop_client_create(E_Client *ec) if ((bname) && (bname[0] == 0)) bname = NULL; bclass = ec->icccm.class; if ((bclass) && (bclass[0] == 0)) bclass = NULL; - btitle = e_client_name_get(ec); + btitle = e_client_util_name_get(ec); desktop_dir = e_user_desktop_dir_get(); diff --git a/src/bin/e_int_client_remember.c b/src/bin/e_int_client_remember.c index 013b325b6..c22c6fe9f 100644 --- a/src/bin/e_int_client_remember.c +++ b/src/bin/e_int_client_remember.c @@ -174,7 +174,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) cfdata->role = strdup(ec->icccm.window_role); if (!cfdata->title) { - const char *title = e_client_name_get(ec); + const char *title = e_client_util_name_get(ec); if (title && title[0]) cfdata->title = strdup(title); } @@ -368,7 +368,7 @@ _check_matches(E_Remember *rem, int update) EINA_LIST_FOREACH(c->clients, ll, ec) { int match = rem->match; - title = e_client_name_get(ec); + title = e_client_util_name_get(ec); if ((match & E_REMEMBER_MATCH_NAME) && (e_util_glob_match(ec->icccm.name, rem->name))) diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index a00ed947a..f584a4fff 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -1203,8 +1203,8 @@ _e_int_menus_clients_sort_alpha_cb(const void *d1, const void *d2) ec1 = d1; ec2 = d2; - name1 = e_client_name_get(ec1); - name2 = e_client_name_get(ec2); + name1 = e_client_util_name_get(ec1); + name2 = e_client_util_name_get(ec2); if (strcasecmp(name1, name2) > 0) return 1; if (strcasecmp(name1, name2) < 0) return -1; @@ -1526,7 +1526,7 @@ _e_int_menus_clients_item_create(E_Client *ec, E_Menu *m) E_Menu_Item *mi; const char *title; - title = _e_int_menus_clients_title_abbrv(e_client_name_get(ec)); + title = _e_int_menus_clients_title_abbrv(e_client_util_name_get(ec)); mi = e_menu_item_new(m); e_menu_item_check_set(mi, 1); if ((title) && (title[0])) @@ -1625,7 +1625,7 @@ _e_int_menus_lost_clients_pre_cb(void *data __UNUSED__, E_Menu *m) { const char *title = ""; - title = e_client_name_get(ec); + title = e_client_util_name_get(ec); mi = e_menu_item_new(m); if ((title) && (title[0])) e_menu_item_label_set(mi, title); diff --git a/src/bin/e_remember.c b/src/bin/e_remember.c index 17fe0abdf..4459de9bb 100644 --- a/src/bin/e_remember.c +++ b/src/bin/e_remember.c @@ -347,7 +347,7 @@ e_remember_default_match_set(E_Remember *rem, E_Client *ec) rem->name = eina_stringshare_ref(name); rem->class = eina_stringshare_ref(clasz); } - else if ((title = e_client_name_get(ec)) && title[0]) + else if ((title = e_client_util_name_get(ec)) && title[0]) { match |= E_REMEMBER_MATCH_TITLE; rem->title = eina_stringshare_ref(title); diff --git a/src/modules/everything/evry_plug_windows.c b/src/modules/everything/evry_plug_windows.c index 9de1cf19f..2f49a1f15 100644 --- a/src/modules/everything/evry_plug_windows.c +++ b/src/modules/everything/evry_plug_windows.c @@ -58,7 +58,7 @@ _client_item_add(Plugin *p, E_Client *ec) if (e_client_util_ignored_get(ec)) return 0; - bi = EVRY_ITEM_NEW(Client_Item, p, e_client_name_get(ec), + bi = EVRY_ITEM_NEW(Client_Item, p, e_client_util_name_get(ec), _icon_get, _client_item_free); snprintf(buf, sizeof(buf), "%d:%d %s", diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 661c937cf..6bc20b797 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -1212,7 +1212,7 @@ _ibar_icon_menu_client_add(IBar_Icon *ic, E_Client *ec) img = e_comp_object_util_mirror_add(ec->frame); evas_object_event_callback_add(img, EVAS_CALLBACK_DEL, _ibar_cb_icon_menu_img_del, it); - txt = e_client_name_get(ec); + txt = e_client_util_name_get(ec); w = ec->client.w; h = ec->client.h; e_comp_object_util_del_list_append(ic->menu->comp_object, img); diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c index 93ae22bdc..edfc2a520 100644 --- a/src/modules/ibox/e_mod_main.c +++ b/src/modules/ibox/e_mod_main.c @@ -619,7 +619,7 @@ _ibox_icon_fill_label(IBox_Icon *ic) break; case 4: - label = e_client_name_get(ic->client); + label = e_client_util_name_get(ic->client); break; } diff --git a/src/modules/illume2/e_illume.c b/src/modules/illume2/e_illume.c index 09644ac0a..babaa9b48 100644 --- a/src/modules/illume2/e_illume.c +++ b/src/modules/illume2/e_illume.c @@ -100,7 +100,7 @@ e_illume_client_is_indicator(E_Client *ec) { const char *title; - if ((title = e_client_name_get(ec))) + if ((title = e_client_util_name_get(ec))) if (!strcmp(title, _e_illume_cfg->policy.indicator.title)) return EINA_TRUE; } @@ -159,7 +159,7 @@ e_illume_client_is_softkey(E_Client *ec) { const char *title; - if ((title = e_client_name_get(ec))) + if ((title = e_client_util_name_get(ec))) if (!strcmp(title, _e_illume_cfg->policy.softkey.title)) return EINA_TRUE; } @@ -217,7 +217,7 @@ e_illume_client_is_keyboard(E_Client *ec) { const char *title; - if ((title = e_client_name_get(ec))) + if ((title = e_client_util_name_get(ec))) if (!strcmp(title, _e_illume_cfg->policy.vkbd.title)) return EINA_TRUE; } @@ -271,7 +271,7 @@ e_illume_client_is_home(E_Client *ec) { const char *title; - if ((title = e_client_name_get(ec))) + if ((title = e_client_util_name_get(ec))) if (!strcmp(title, _e_illume_cfg->policy.home.title)) return EINA_TRUE; } diff --git a/src/modules/illume2/e_mod_select_window.c b/src/modules/illume2/e_mod_select_window.c index 9f53aaadb..d56201739 100644 --- a/src/modules/illume2/e_mod_select_window.c +++ b/src/modules/illume2/e_mod_select_window.c @@ -81,7 +81,7 @@ _e_mod_illume_config_select_window_create(E_Config_Dialog *cfd __UNUSED__, Evas if (e_client_util_ignored_get(ec)) continue; if (ec->zone != zone) continue; if (e_object_is_del(E_OBJECT(ec))) continue; - if (!(name = e_client_name_get(ec))) continue; + if (!(name = e_client_util_name_get(ec))) continue; if (_e_mod_illume_config_select_window_match(ec)) sel = i; e_widget_ilist_append(ow, NULL, name, _e_mod_illume_config_select_window_list_changed, diff --git a/src/modules/illume2/policies/tablet/policy.c b/src/modules/illume2/policies/tablet/policy.c index 5f9810b9b..e3595e74f 100644 --- a/src/modules/illume2/policies/tablet/policy.c +++ b/src/modules/illume2/policies/tablet/policy.c @@ -34,7 +34,7 @@ static void _policy_border_set_focus(E_Client *ec) { if (!ec) return; - /* printf("_policy_border_set_focus %s\n", e_client_name_get(ec)); */ + /* printf("_policy_border_set_focus %s\n", e_client_util_name_get(ec)); */ /* if focus is locked out then get out */ if (ec->lock_focus_out) return; @@ -161,7 +161,7 @@ _policy_border_show_below(E_Client *ec) // ec->icccm.class, ec->x, ec->y); if (!ec) return; - /* printf("_policy_border_show_below %s\n", e_client_name_get(ec)); */ + /* printf("_policy_border_show_below %s\n", e_client_util_name_get(ec)); */ if (ec->icccm.transient_for) { if ((prev = e_pixmap_find_client(E_PIXMAP_TYPE_X, ec->icccm.transient_for))) @@ -1024,7 +1024,7 @@ _policy_border_show(E_Client *ec) { if (!ec) return; - /* printf("_policy_border_show %s\n", e_client_name_get(ec)); */ + /* printf("_policy_border_show %s\n", e_client_util_name_get(ec)); */ if (!ec->icccm.name) return; diff --git a/src/modules/notification/e_mod_popup.c b/src/modules/notification/e_mod_popup.c index f22f3b2e7..b2bcfa8af 100644 --- a/src/modules/notification/e_mod_popup.c +++ b/src/modules/notification/e_mod_popup.c @@ -139,7 +139,7 @@ _notification_theme_cb_find(Popup_Data *popup, if (e_client_util_ignored_get(ec)) continue; len = strlen(popup->app_name); - name = e_client_name_get(ec); + name = e_client_util_name_get(ec); if (!name) continue; test = eina_strlen_bounded(name, len + 1); diff --git a/src/modules/tasks/e_mod_main.c b/src/modules/tasks/e_mod_main.c index 2f613ebf5..177feebc4 100644 --- a/src/modules/tasks/e_mod_main.c +++ b/src/modules/tasks/e_mod_main.c @@ -646,7 +646,7 @@ _tasks_item_fill(Tasks_Item *item) if (item->tasks->config->icon_only) label = ""; else - label = e_client_name_get(item->client); + label = e_client_util_name_get(item->client); edje_object_part_text_set(item->o_item, "e.text.label", label); if (item->client->iconic) diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index 470d96784..d95a64453 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c @@ -819,7 +819,7 @@ _e_winlist_client_add(E_Client *ec, E_Zone *zone, E_Desk *desk) ww->bg_object = o; e_theme_edje_object_set(o, "base/theme/winlist", "e/widgets/winlist/item"); - edje_object_part_text_set(o, "e.text.label", e_client_name_get(ww->client)); + edje_object_part_text_set(o, "e.text.label", e_client_util_name_get(ww->client)); evas_object_show(o); if (edje_object_part_exists(ww->bg_object, "e.swallow.icon")) { @@ -972,7 +972,7 @@ _e_winlist_activate(void) } } edje_object_part_text_set(_bg_object, "e.text.label", - e_client_name_get(ww->client)); + e_client_util_name_get(ww->client)); if (_icon_object) { e_comp_object_util_del_list_remove(_winlist, _icon_object);