X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus_cycle_popup.c;h=b827e524ff7ff8b850b98f31e36d8e02fd0bacff;hb=571b09f999585c66e9781877c94807f663c2bd4c;hp=89468493470b044cbfb0727614e30c957e1ad05d;hpb=9943a713e974473f52d951103efd9b6bda6dd753;p=chaz%2Fopenbox diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index 89468493..b827e524 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -211,31 +211,26 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets, static gchar *popup_get_name(ObClient *c) { ObClient *p; - gchar *title = NULL; + gchar *title; const gchar *desk = NULL; gchar *ret; - /* find our highest direct parent, including non-normal windows */ - for (p = c; p->transient_for && p->transient_for != OB_TRAN_GROUP; - p = p->transient_for); + /* find our highest direct parent */ + p = client_search_top_direct_parent(c); if (c->desktop != DESKTOP_ALL && c->desktop != screen_desktop) desk = screen_desktop_names[c->desktop]; - /* use the transient's parent's title/icon if we don't have one */ - if (p != c && !strcmp("", (c->iconic ? c->icon_title : c->title))) - title = g_strdup(p->iconic ? p->icon_title : p->title); + title = c->iconic ? c->icon_title : c->title; - if (title == NULL) - title = g_strdup(c->iconic ? c->icon_title : c->title); + /* use the transient's parent's title/icon if we don't have one */ + if (p != c && title[0] == '\0') + title = p->iconic ? p->icon_title : p->title; if (desk) ret = g_strdup_printf("%s [%s]", title, desk); - else { - ret = title; - title = NULL; - } - g_free(title); + else + ret = g_strdup(title); return ret; }