aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-02-15 21:34:53 -0500
committerDavid Robillard <d@drobilla.net>2023-02-15 21:51:14 -0500
commitc1981dac09e9f630a51dcce4502619dc84474266 (patch)
tree7696aa59b729b75e40a03169b9180c1723d33335
parent609aed744bf205c992a10dab79109e3d6df1991d (diff)
downloadpugl-c1981dac09e9f630a51dcce4502619dc84474266.tar.gz
pugl-c1981dac09e9f630a51dcce4502619dc84474266.tar.bz2
pugl-c1981dac09e9f630a51dcce4502619dc84474266.zip
Fix crash on views with no title set
-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;
}