]> git.mdlowis.com Git - proto/labwc.git/commitdiff
ssd/ssd_titlebar.c: Only store title state if title has been changed
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Thu, 24 Feb 2022 00:37:19 +0000 (01:37 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 24 Feb 2022 06:56:25 +0000 (06:56 +0000)
src/ssd/ssd_titlebar.c

index 968bd1443152d861f091f5beba3bf0359e53f863..1c7d9876551b98ff011a3bac2f54091baee48e48 100644 (file)
@@ -255,10 +255,12 @@ ssd_update_title(struct view *view)
                dstate->truncated = rect->width <= dstate->width;
        } FOR_EACH_END
 
-       if (state->text) {
-               free(state->text);
+       if (!title_unchanged) {
+               if (state->text) {
+                       free(state->text);
+               }
+               state->text = strdup(title);
        }
-       state->text = strdup(title);
        ssd_update_title_positions(view);
 }