From: Mikael Magnusson Date: Tue, 18 Dec 2007 20:42:29 +0000 (+0100) Subject: Don't update hints when the title is the same. X-Git-Tag: mikabox-3.4.5^0 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=ee21287e4601e4354fc5486b08d6e5e586215a2b;p=mikachu%2Fopenbox.git Don't update hints when the title is the same. What I really wanted was to not redraw the titlebar but that seems much harder. --- diff --git a/openbox/client.c b/openbox/client.c index 8da586ac..c794aae6 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1907,8 +1907,6 @@ void client_update_title(ObClient *self) gchar *data = NULL; gchar *visible = NULL; - g_free(self->title); - /* try netwm */ if (!PROP_GETS(self->window, net_wm_name, utf8, &data)) { /* try old x stuff */ @@ -1931,15 +1929,18 @@ void client_update_title(ObClient *self) } else visible = data; - PROP_SETS(self->window, net_wm_visible_name, visible); - self->title = visible; + if (!self->title || strcmp(self->title, visible)) { + PROP_SETS(self->window, net_wm_visible_name, visible); + g_free(self->title); + self->title = visible; + } else + g_free(visible); if (self->frame) frame_adjust_title(self->frame); /* update the icon title */ data = NULL; - g_free(self->icon_title); /* try netwm */ if (!PROP_GETS(self->window, net_wm_icon_name, utf8, &data)) @@ -1954,8 +1955,12 @@ void client_update_title(ObClient *self) } else visible = data; - PROP_SETS(self->window, net_wm_visible_icon_name, visible); - self->icon_title = visible; + if (!self->icon_title || strcmp(self->icon_title, visible)) { + PROP_SETS(self->window, net_wm_visible_icon_name, visible); + g_free(self->icon_title); + self->icon_title = visible; + } else + g_free(visible); } void client_update_strut(ObClient *self)