diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-05-09 22:53:11 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-05-09 22:53:11 +0000 |
| commit | d5eacc5642ad8f5611f7c946d734863bc8898513 (patch) | |
| tree | 38ba2c64fa2ce6ba82a1c4649b8ae83ff58b10bb /openbox/client.c | |
| parent | 380ddd2b9cd2ffd8d286855b0670e58a553b2b3d (diff) | |
add a client_activate function, use it for net_wm_active mesgs and for focus cycling.
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/openbox/client.c b/openbox/client.c index 2cd92125..dd25e4d2 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1192,6 +1192,7 @@ void client_update_title(Client *self) guint32 nums; guint i; char *data = NULL; + gboolean read_title; g_free(self->title); @@ -1236,15 +1237,18 @@ void client_update_title(Client *self) /* update the icon title */ data = NULL; g_free(self->icon_title); - + + read_title = TRUE; /* try netwm */ if (!PROP_GETS(self->window, net_wm_icon_name, utf8, &data)) /* try old x stuff */ - if (!PROP_GETS(self->window, wm_icon_name, locale, &data)) - data = g_strdup("Unnamed Window"); + if (!PROP_GETS(self->window, wm_icon_name, locale, &data)) { + data = g_strdup(self->title); + read_title = FALSE; + } /* append the title count, dont display the number for the first window */ - if (self->title_count > 1) { + if (read_title && self->title_count > 1) { char *vdata, *ndata; ndata = g_strdup_printf(" - [%u]", self->title_count); vdata = g_strconcat(data, ndata, NULL); @@ -2292,6 +2296,22 @@ void client_unfocus(Client *self) focus_fallback(Fallback_Unfocusing); } +void client_activate(Client *self) +{ + if (client_normal(self) && screen_showing_desktop) + screen_show_desktop(FALSE); + if (self->iconic) + client_iconify(self, FALSE, TRUE); + else if (!self->frame->visible) + /* if its not visible for other reasons, then don't mess + with it */ + return; + if (self->shaded) + client_shade(self, FALSE); + client_focus(self); + stacking_raise(self); +} + gboolean client_focused(Client *self) { return self == focus_client; |
