Don't update hints when the title is the same. mikabox-3.4.5
authorMikael Magnusson <mikachu@comhem.se>
Tue, 18 Dec 2007 20:42:29 +0000 (21:42 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 06:26:35 +0000 (07:26 +0100)
What I really wanted was to not redraw the titlebar but that seems much harder.

openbox/client.c

index 8da586acbe67b8b439f88270a96f3eacd6d08593..c794aae6b0ead6c460bc5b404c326ba6b0e3393a 100644 (file)
@@ -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)