xrdp: added xrdp.ini options to auto execute a modules and hide log window
This commit is contained in:
parent
238d14b60a
commit
b124612675
@ -91,7 +91,7 @@ xrdp_wm_send_palette(struct xrdp_wm* self);
|
|||||||
int APP_CC
|
int APP_CC
|
||||||
xrdp_wm_send_bell(struct xrdp_wm* self);
|
xrdp_wm_send_bell(struct xrdp_wm* self);
|
||||||
int APP_CC
|
int APP_CC
|
||||||
xrdp_wm_load_static_colors(struct xrdp_wm* self);
|
xrdp_wm_load_static_colors_plus(struct xrdp_wm* self, char* autorun_name);
|
||||||
int APP_CC
|
int APP_CC
|
||||||
xrdp_wm_load_static_pointers(struct xrdp_wm* self);
|
xrdp_wm_load_static_pointers(struct xrdp_wm* self);
|
||||||
int APP_CC
|
int APP_CC
|
||||||
|
@ -15,6 +15,8 @@ max_bpp=24
|
|||||||
#red=ff0000
|
#red=ff0000
|
||||||
#green=00ff00
|
#green=00ff00
|
||||||
#background=626c72
|
#background=626c72
|
||||||
|
#autorun=xrdp7
|
||||||
|
#hidelogwindow=yes
|
||||||
|
|
||||||
[xrdp1]
|
[xrdp1]
|
||||||
name=sesman-Xvnc
|
name=sesman-Xvnc
|
||||||
|
@ -1522,7 +1522,7 @@ server_reset(struct xrdp_mod* mod, int width, int height, int bpp)
|
|||||||
xrdp_bitmap_resize(wm->screen, wm->client_info->width,
|
xrdp_bitmap_resize(wm->screen, wm->client_info->width,
|
||||||
wm->client_info->height);
|
wm->client_info->height);
|
||||||
/* load some stuff */
|
/* load some stuff */
|
||||||
xrdp_wm_load_static_colors(wm);
|
xrdp_wm_load_static_colors_plus(wm, 0);
|
||||||
xrdp_wm_load_static_pointers(wm);
|
xrdp_wm_load_static_pointers(wm);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -266,6 +266,7 @@ struct xrdp_wm
|
|||||||
struct xrdp_mm* mm;
|
struct xrdp_mm* mm;
|
||||||
struct xrdp_font* default_font;
|
struct xrdp_font* default_font;
|
||||||
struct xrdp_keymap keymap;
|
struct xrdp_keymap keymap;
|
||||||
|
int hide_log_window;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* rdp process */
|
/* rdp process */
|
||||||
|
@ -309,7 +309,7 @@ unsigned int xrdp_wm_htoi (const char *ptr)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
int APP_CC
|
int APP_CC
|
||||||
xrdp_wm_load_static_colors(struct xrdp_wm* self)
|
xrdp_wm_load_static_colors_plus(struct xrdp_wm* self, char* autorun_name)
|
||||||
{
|
{
|
||||||
int bindex;
|
int bindex;
|
||||||
int gindex;
|
int gindex;
|
||||||
@ -322,6 +322,11 @@ xrdp_wm_load_static_colors(struct xrdp_wm* self)
|
|||||||
struct list* values;
|
struct list* values;
|
||||||
char cfg_file[256];
|
char cfg_file[256];
|
||||||
|
|
||||||
|
if (autorun_name != 0)
|
||||||
|
{
|
||||||
|
autorun_name[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* initialize with defaults */
|
/* initialize with defaults */
|
||||||
self->black = HCOLOR(self->screen->bpp,0x000000);
|
self->black = HCOLOR(self->screen->bpp,0x000000);
|
||||||
self->grey = HCOLOR(self->screen->bpp,0xc0c0c0);
|
self->grey = HCOLOR(self->screen->bpp,0xc0c0c0);
|
||||||
@ -394,6 +399,24 @@ xrdp_wm_load_static_colors(struct xrdp_wm* self)
|
|||||||
val = (char*)list_get_item(values, index);
|
val = (char*)list_get_item(values, index);
|
||||||
self->background = HCOLOR(self->screen->bpp,xrdp_wm_htoi(val));
|
self->background = HCOLOR(self->screen->bpp,xrdp_wm_htoi(val));
|
||||||
}
|
}
|
||||||
|
else if (g_strcasecmp(val, "autorun") == 0)
|
||||||
|
{
|
||||||
|
val = (char*)list_get_item(values, index);
|
||||||
|
if (autorun_name != 0)
|
||||||
|
{
|
||||||
|
g_strncpy(autorun_name, val, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (g_strcasecmp(val, "hidelogwindow") == 0)
|
||||||
|
{
|
||||||
|
val = (char*)list_get_item(values, index);
|
||||||
|
if ((g_strcasecmp(val, "yes") == 0) ||
|
||||||
|
(g_strcasecmp(val, "1") == 0) ||
|
||||||
|
(g_strcasecmp(val, "true") == 0))
|
||||||
|
{
|
||||||
|
self->hide_log_window = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -462,11 +485,12 @@ xrdp_wm_init(struct xrdp_wm* self)
|
|||||||
char* r;
|
char* r;
|
||||||
char section_name[256];
|
char section_name[256];
|
||||||
char cfg_file[256];
|
char cfg_file[256];
|
||||||
|
char autorun_name[256];
|
||||||
|
|
||||||
xrdp_wm_load_static_colors(self);
|
xrdp_wm_load_static_colors_plus(self, autorun_name);
|
||||||
xrdp_wm_load_static_pointers(self);
|
xrdp_wm_load_static_pointers(self);
|
||||||
self->screen->bg_color = self->background;
|
self->screen->bg_color = self->background;
|
||||||
if (self->session->client_info->rdp_autologin)
|
if (self->session->client_info->rdp_autologin || (autorun_name[0] != 0))
|
||||||
{
|
{
|
||||||
g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH);
|
g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH);
|
||||||
fd = g_file_open(cfg_file); /* xrdp.ini */
|
fd = g_file_open(cfg_file); /* xrdp.ini */
|
||||||
@ -479,7 +503,10 @@ xrdp_wm_init(struct xrdp_wm* self)
|
|||||||
g_strncpy(section_name, self->session->client_info->domain, 255);
|
g_strncpy(section_name, self->session->client_info->domain, 255);
|
||||||
if (section_name[0] == 0)
|
if (section_name[0] == 0)
|
||||||
{
|
{
|
||||||
/* if no doamin is passed, use the first item in the xrdp.ini
|
if (autorun_name[0] == 0)
|
||||||
|
{
|
||||||
|
/* if no doamin is passed, and no autorun in xrdp.ini,
|
||||||
|
use the first item in the xrdp.ini
|
||||||
file thats not named 'globals' */
|
file thats not named 'globals' */
|
||||||
file_read_sections(fd, names);
|
file_read_sections(fd, names);
|
||||||
for (index = 0; index < names->count; index++)
|
for (index = 0; index < names->count; index++)
|
||||||
@ -492,6 +519,11 @@ xrdp_wm_init(struct xrdp_wm* self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_strncpy(section_name, autorun_name, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
list_clear(names);
|
list_clear(names);
|
||||||
if (file_read_section(fd, section_name, names, values) == 0)
|
if (file_read_section(fd, section_name, names, values) == 0)
|
||||||
{
|
{
|
||||||
@ -1526,6 +1558,10 @@ xrdp_wm_log_msg(struct xrdp_wm* self, char* msg)
|
|||||||
int xoffset;
|
int xoffset;
|
||||||
int yoffset;
|
int yoffset;
|
||||||
|
|
||||||
|
if (self->hide_log_window)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
list_add_item(self->log, (long)g_strdup(msg));
|
list_add_item(self->log, (long)g_strdup(msg));
|
||||||
if (self->log_wnd == 0)
|
if (self->log_wnd == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user