added support for optional background image

ulab-next-nosound
ArvidNorr 11 years ago
parent 1d1eb037f3
commit 5030b97d24

@ -68,6 +68,9 @@ ls_height=430
# login screen background color in RGB format # login screen background color in RGB format
ls_bg_color=dedede ls_bg_color=dedede
# optional background image filename (bmp format).
#ls_background_image=
# logo # logo
# full path to bmp-file or file in shared folder # full path to bmp-file or file in shared folder
ls_logo_filename= ls_logo_filename=

@ -576,6 +576,23 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
if (regular) if (regular)
{ {
// Load the background image.
// If no file is specified no default image will be loaded.
// We only load the image if bpp > 8
if (globals->ls_background_image[0] != 0 && self->screen->bpp > 8)
{
char fileName[256] ;
but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self);
g_snprintf(fileName, 255, "%s/%s", XRDP_SHARE_PATH, globals->ls_background_image);
log_message(LOG_LEVEL_DEBUG, "We try to load the following background file: %s", fileName);
xrdp_bitmap_load(but, fileName, self->palette);
but->parent = self->screen;
but->owner = self->screen;
but->left = self->screen->width - but->width;
but->top = self->screen->height - but->height;
list_add_item(self->screen->child_list, (long)but);
}
/* if logo image not specified, use default */ /* if logo image not specified, use default */
if (globals->ls_logo_filename[0] == 0) if (globals->ls_logo_filename[0] == 0)
g_snprintf(globals->ls_logo_filename, 255, "%s/xrdp_logo.bmp", XRDP_SHARE_PATH); g_snprintf(globals->ls_logo_filename, 255, "%s/xrdp_logo.bmp", XRDP_SHARE_PATH);
@ -848,7 +865,11 @@ load_xrdp_config(struct xrdp_config *config, int bpp)
g_strncpy(globals->ls_logo_filename, v, 255); g_strncpy(globals->ls_logo_filename, v, 255);
globals->ls_logo_filename[255] = 0; globals->ls_logo_filename[255] = 0;
} }
else if (g_strncmp(n, "ls_background_image", 255) == 0)
{
g_strncpy(globals->ls_background_image, v, 255);
globals->ls_background_image[255] = 0;
}
else if (g_strncmp(n, "ls_logo_x_pos", 64) == 0) else if (g_strncmp(n, "ls_logo_x_pos", 64) == 0)
globals->ls_logo_x_pos = g_atoi(v); globals->ls_logo_x_pos = g_atoi(v);

@ -580,6 +580,7 @@ struct xrdp_cfg_globals
int ls_height; /* window height */ int ls_height; /* window height */
int ls_bg_color; /* background color */ int ls_bg_color; /* background color */
char ls_logo_filename[256]; /* logo filename */ char ls_logo_filename[256]; /* logo filename */
char ls_background_image[256]; /* background image file name */
int ls_logo_x_pos; /* logo x co-ordinate */ int ls_logo_x_pos; /* logo x co-ordinate */
int ls_logo_y_pos; /* logo y co-ordinate */ int ls_logo_y_pos; /* logo y co-ordinate */
int ls_label_x_pos; /* x pos of labels */ int ls_label_x_pos; /* x pos of labels */

Loading…
Cancel
Save