Don't update hints when the title is the same.
authorMikael Magnusson <mikachu@comhem.se>
Thu, 7 Feb 2008 15:15:45 +0000 (16:15 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 28 Feb 2008 03:35:11 +0000 (04:35 +0100)
What I really wanted was to not redraw the titlebar but that seems much harder.

openbox/client.c

index 66006a48917571f8758fa9cab3fa2c36ccda9a75..bfc2c5b3f348d7d4bfb259dfccc741aeaa69ee27 100644 (file)
@@ -1898,7 +1898,6 @@ void client_update_title(ObClient *self)
     gchar *data = NULL;
     gchar *visible = NULL;
 
-    g_free(self->title);
     g_free(self->original_title);
 
     /* try netwm */
@@ -1933,15 +1932,18 @@ void client_update_title(ObClient *self)
         g_free(data);
     }
 
-    OBT_PROP_SETS(self->window, NET_WM_VISIBLE_NAME, utf8, visible);
-    self->title = visible;
+    if (!self->title || strcmp(self->title, visible)) {
+        OBT_PROP_SETS(self->window, NET_WM_VISIBLE_NAME, utf8, 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(self->window, NET_WM_ICON_NAME, utf8, &data))
@@ -1965,8 +1967,12 @@ void client_update_title(ObClient *self)
         g_free(data);
     }
 
-    OBT_PROP_SETS(self->window, NET_WM_VISIBLE_ICON_NAME, utf8, visible);
-    self->icon_title = visible;
+    if (!self->icon_title || strcmp(self->icon_title, visible)) {
+        OBT_PROP_SETS(self->window, NET_WM_VISIBLE_ICON_NAME, utf8, visible);
+        g_free(self->icon_title);
+        self->icon_title = visible;
+    } else
+        g_free(visible);
 }
 
 void client_update_strut(ObClient *self)