diff options
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r-- | pugl/detail/x11.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index f000b02..e4da9d9 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -215,10 +215,7 @@ puglCreateWindow(PuglView* view, const char* title) XSetClassHint(display, win, &classHint); if (title) { - XStoreName(display, win, title); - XChangeProperty(display, win, atoms->NET_WM_NAME, - atoms->UTF8_STRING, 8, PropModeReplace, - (const uint8_t*)title, (int)strlen(title)); + puglSetWindowTitle(view, title); } if (!view->parent) { @@ -713,6 +710,21 @@ puglGetNativeWindow(PuglView* view) } PuglStatus +puglSetWindowTitle(PuglView* view, const char* title) +{ + Display* display = view->world->impl->display; + const PuglX11Atoms* const atoms = &view->world->impl->atoms; + + puglSetString(&view->title, title); + XStoreName(display, view->impl->win, title); + XChangeProperty(display, view->impl->win, atoms->NET_WM_NAME, + atoms->UTF8_STRING, 8, PropModeReplace, + (const uint8_t*)title, (int)strlen(title)); + + return PUGL_SUCCESS; +} + +PuglStatus puglSetFrame(PuglView* view, const PuglRect frame) { view->frame = frame; |