From 5b5da9985730592b25f767ef70a247f85e80a714 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 17 May 2023 12:04:18 +0200 Subject: Add new function: cherry_window_get_title() --- src/window.c | 10 ++++++++++ src/window.h | 1 + 2 files changed, 11 insertions(+) (limited to 'src') 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); -- cgit v1.2.3