diff options
author | 2023-05-17 12:04:18 +0200 | |
---|---|---|
committer | 2023-05-17 12:04:18 +0200 | |
commit | 5b5da9985730592b25f767ef70a247f85e80a714 (patch) | |
tree | e96768834febc63cb066e8f65194e1dd5db52b0a /src | |
parent | 19949f63207b41aa24f403ccca881d3d0d2c41a1 (diff) | |
download | cherry-5b5da9985730592b25f767ef70a247f85e80a714.tar.gz cherry-5b5da9985730592b25f767ef70a247f85e80a714.zip |
Add new function: cherry_window_get_title()
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 10 | ||||
-rw-r--r-- | src/window.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index 7912bd0..fb0ae90 100644 --- a/src/window.c +++ b/src/window.c @@ -55,6 +55,16 @@ cherry_window_new(void) return w; } +char * +cherry_window_get_title(CherryWindow *w) +{ + char *wnd_name; + CherryApplication *app = cherry_application_get_running_app(); + XFetchName(app->display, w->window_handler, &wnd_name); + + return wnd_name; +} + void cherry_window_set_title(CherryWindow *w, char *title) { diff --git a/src/window.h b/src/window.h index 9f3962c..e22badc 100644 --- a/src/window.h +++ b/src/window.h @@ -16,6 +16,7 @@ typedef struct { } CherryWindow; CherryWindow *cherry_window_new(void); +char *cherry_window_get_title(CherryWindow *); void cherry_window_set_title(CherryWindow *, char *); void cherry_window_set_dimension(CherryWindow *, int, int); void cherry_window_set_position(CherryWindow *, int, int); |