From bf43deabf1fc1a7671ca012040bd9c66aa55242a Mon Sep 17 00:00:00 2001 From: Cocoon Date: Thu, 17 Apr 2014 16:08:50 +0200 Subject: [PATCH] make login screen window title configurable --- xrdp/xrdp.ini | 4 ++++ xrdp/xrdp_login_wnd.c | 23 ++++++++++++++++++++--- xrdp/xrdp_types.h | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini index 22e7d644..b27e0fbe 100644 --- a/xrdp/xrdp.ini +++ b/xrdp/xrdp.ini @@ -55,6 +55,9 @@ use_fastpath=both # configure login screen # +# Login Screen Window Title +#ls_title=My Login Title + # top level window background color in RGB format ls_top_window_bg_color=009cb5 @@ -66,6 +69,7 @@ ls_height=430 ls_bg_color=dedede # logo +# full path to bmp-file or file in shared folder ls_logo_filename= ls_logo_x_pos=55 ls_logo_y_pos=50 diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c index bf4fcb12..50ac89fd 100644 --- a/xrdp/xrdp_login_wnd.c +++ b/xrdp/xrdp_login_wnd.c @@ -560,9 +560,19 @@ xrdp_login_wnd_create(struct xrdp_wm *self) self->login_window->notify = xrdp_wm_login_notify; - g_gethostname(buf1, 256); - g_sprintf(buf, "Login to %s", buf1); - set_string(&self->login_window->caption1, buf); + /* if window title not specified, use hostname as default */ + if (globals->ls_title[0] == 0) + { + g_gethostname(buf1, 256); + g_sprintf(buf, "Login 1 to %s", buf1); + set_string(&self->login_window->caption1, buf); + } + else + { + /*self->login_window->caption1 = globals->ls_title[0];*/ + g_sprintf(buf, "%s", globals->ls_title); + set_string(&self->login_window->caption1, buf); + } if (regular) { @@ -827,6 +837,12 @@ load_xrdp_config(struct xrdp_config *config, int bpp) else if (g_strncmp(n, "ls_bg_color", 64) == 0) globals->ls_bg_color = HCOLOR(bpp, xrdp_wm_htoi(v)); + else if (g_strncmp(n, "ls_title", 255) == 0) + { + g_strncpy(globals->ls_title, v, 255); + globals->ls_title[255] = 0; + } + else if (g_strncmp(n, "ls_logo_filename", 255) == 0) { g_strncpy(globals->ls_logo_filename, v, 255); @@ -917,6 +933,7 @@ load_xrdp_config(struct xrdp_config *config, int bpp) g_writeln("ls_width: %d", globals->ls_width); g_writeln("ls_height: %d", globals->ls_height); g_writeln("ls_bg_color: %x", globals->ls_bg_color); + g_writeln("ls_title: %s", globals->ls_title); g_writeln("ls_logo_filename: %s", globals->ls_logo_filename); g_writeln("ls_logo_x_pos: %d", globals->ls_logo_x_pos); g_writeln("ls_logo_y_pos: %d", globals->ls_logo_y_pos); diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index 7e1c81f0..973b64e8 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -595,6 +595,7 @@ struct xrdp_cfg_globals int ls_btn_cancel_y_pos; /* y pos for Cancel button */ int ls_btn_cancel_width; /* width of Cancel button */ int ls_btn_cancel_height; /* height of Cancel button */ + char ls_title[256]; /* loginscreen window title */ }; struct xrdp_cfg_logging