From 541e417a7dec2ba05e64b7257817af706a4a7b92 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 7 Feb 2008 16:15:45 +0100 Subject: [PATCH] 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. --- openbox/client.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 78993127..584e029c 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2099,7 +2099,6 @@ void client_update_title(ObClient *self) gchar *data = NULL; gchar *visible = NULL; - g_free(self->title); g_free(self->original_title); /* try netwm */ @@ -2139,15 +2138,18 @@ void client_update_title(ObClient *self) g_free(data); } - OBT_PROP_SETS(self->window, NET_WM_VISIBLE_NAME, visible); - self->title = visible; + if (!self->title || strcmp(self->title, visible)) { + OBT_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 (!OBT_PROP_GETS_UTF8(self->window, NET_WM_ICON_NAME, &data)) @@ -2170,8 +2172,12 @@ void client_update_title(ObClient *self) g_free(data); } - OBT_PROP_SETS(self->window, NET_WM_VISIBLE_ICON_NAME, visible); - self->icon_title = visible; + if (!self->icon_title || strcmp(self->icon_title, visible)) { + OBT_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) -- 2.34.1