From a5aa53657c6feaf8ddd29ee33f8d5e89138ec996 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 8 May 2019 00:35:09 +0100 Subject: get the window title from a gui_window --- frontends/amiga/arexx.c | 2 +- frontends/amiga/gui.c | 7 +++++++ frontends/amiga/gui.h | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'frontends') diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c index 6d1bdf12b..5b5f0ea09 100644 --- a/frontends/amiga/arexx.c +++ b/frontends/amiga/arexx.c @@ -421,7 +421,7 @@ RXHOOKF(rx_gettitle) if(ami_gui_get_gui_window_2(gw)->tabs > 1) strcpy(result, ami_gui_get_tab_title(gw)); else - strcpy(result, ami_gui_get_gui_window_2(gw)->wintitle); + strcpy(result, ami_gui_get_win_title(gw)); } else { diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index e9ceb1a6e..3920616e3 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -320,6 +320,13 @@ struct gui_window *ami_gui2_get_gui_window(struct gui_window_2 *gwin) return gwin->gw; } +const char *ami_gui_get_win_title(struct gui_window *gw) +{ + assert(gw != NULL); + assert(gw->shared != NULL); + return (const char *)gw->shared->wintitle; +} + const char *ami_gui_get_tab_title(struct gui_window *gw) { assert(gw != NULL); diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h index e16390147..e1042c517 100644 --- a/frontends/amiga/gui.h +++ b/frontends/amiga/gui.h @@ -287,6 +287,11 @@ struct List *ami_gui_get_download_list(struct gui_window *gw); */ const char *ami_gui_get_tab_title(struct gui_window *gw); +/** + * Get window title from gui_window + */ +const char *ami_gui_get_win_title(struct gui_window *gw); + /** * Get tab node from gui_window */ -- cgit v1.2.3