aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/x11.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/x11.c b/src/x11.c
index 6c39cce..67d579a 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -1891,15 +1891,17 @@ puglViewStringChanged(PuglView* const view,
break;
case PUGL_WINDOW_TITLE:
- XStoreName(display, view->impl->win, value);
- XChangeProperty(display,
- view->impl->win,
- atoms->NET_WM_NAME,
- atoms->UTF8_STRING,
- 8,
- PropModeReplace,
- (const uint8_t*)value,
- (int)strlen(value));
+ if (value) {
+ XStoreName(display, view->impl->win, value);
+ XChangeProperty(display,
+ view->impl->win,
+ atoms->NET_WM_NAME,
+ atoms->UTF8_STRING,
+ 8,
+ PropModeReplace,
+ (const uint8_t*)value,
+ (int)strlen(value));
+ }
break;
}