diff options
author | 2023-05-30 01:02:33 +0200 | |
---|---|---|
committer | 2023-05-30 01:02:33 +0200 | |
commit | d3d706fa2ff8eb69791d829745e8f7cb4fe18f5e (patch) | |
tree | f2e72b9e0e4186c9552fbf5e7dde1c1dc465ea4f /src | |
parent | 3e723993dbb97b329994bde12a07c1ae6fc29739 (diff) | |
download | cherry-d3d706fa2ff8eb69791d829745e8f7cb4fe18f5e.tar.gz cherry-d3d706fa2ff8eb69791d829745e8f7cb4fe18f5e.zip |
Fix cherry_window_get_title()
The title can be obtained only if the window has drawn, otherwise must be
retrieved by title attribute of CherryWindow.
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index 491e2b7..23c8abf 100644 --- a/src/window.c +++ b/src/window.c @@ -111,11 +111,16 @@ cherry_window_dispose_on_exit(CherryWindow *w) } char * -cherry_window_get_title(CherryWindow *w) +cherry_window_get_title(CherryWindow *window) { char *wnd_name; - CherryApplication *app = cherry_application_get_running_app(); - XFetchName(app->display, w->window_handler, &wnd_name); + + if (window->base.drawn) { + CherryApplication *app = cherry_application_get_running_app(); + XFetchName(app->display, window->window_handler, &wnd_name); + } else { + wnd_name = window->title; + } return wnd_name; } |