aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11.c')
-rw-r--r--src/x11.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/x11.c b/src/x11.c
index 2511632..b4f68a7 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -625,9 +625,10 @@ puglRealize(PuglView* const view)
#endif
// Set basic window hints and attributes
- XClassHint classHint = {world->className, world->className};
+ char* const className = world->strings[PUGL_CLASS_NAME];
+ XClassHint classHint = {className, className};
XSetClassHint(display, impl->win, &classHint);
- puglSetWindowTitle(view, view->title ? view->title : "");
+ puglSetViewString(view, PUGL_WINDOW_TITLE, view->strings[PUGL_WINDOW_TITLE]);
puglSetTransientParent(view, view->transientParent);
updateSizeHints(view);
@@ -1881,23 +1882,32 @@ puglGetNativeView(PuglView* const view)
}
PuglStatus
-puglSetWindowTitle(PuglView* const view, const char* const title)
+puglViewStringChanged(PuglView* const view,
+ const PuglStringHint key,
+ const char* const value)
{
- Display* display = view->world->impl->display;
- const PuglX11Atoms* const atoms = &view->world->impl->atoms;
+ Display* const display = view->world->impl->display;
+ const PuglX11Atoms* atoms = &view->world->impl->atoms;
+
+ if (!view->impl->win) {
+ return PUGL_SUCCESS;
+ }
- puglSetString(&view->title, title);
+ switch (key) {
+ case PUGL_CLASS_NAME:
+ break;
- if (view->impl->win) {
- XStoreName(display, view->impl->win, title);
+ 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*)title,
- (int)strlen(title));
+ (const uint8_t*)value,
+ (int)strlen(value));
+ break;
}
return PUGL_SUCCESS;