Hi!
I made an patch for FreeRDP to support alternative window titles
configurable via a command line option.
I don't know if this is the right way to deliver the patch, following your
code standards (although I tried to adapt the style of the other code) or if
this is the best way to do it. This is my first time coding anything in this
language (C?).
So see for yourself what you are going to do with this patch, I thought it
would be useful to post here.
diff --git a/X11/xf_win.c b/X11/xf_win.c
index f657639..0bc0bb2 100644
--- a/X11/xf_win.c
+++ b/X11/xf_win.c
@@ -1295,7 +1295,10 @@ xf_post_connect(xfInfo * xfi)
}
char win_title[64];
- if (xfi->settings->tcp_port_rdp == 3389)
+ printf("komt ie:%s", xfi->settings->window_title);
+ if (strlen(xfi->settings->window_title) > 0)
+ snprintf(win_title, sizeof(win_title), "%s", xfi->settings->window_title);
+ else if (xfi->settings->tcp_port_rdp == 3389)
snprintf(win_title, sizeof(win_title), "%s - freerdp", xfi->settings->server);
else
snprintf(win_title, sizeof(win_title), "%s:%d - freerdp", xfi->settings->server, xfi->settings->tcp_port_rdp);
diff --git a/X11/xfreerdp.c b/X11/xfreerdp.c
index 87c8960..2c216da 100644
--- a/X11/xfreerdp.c
+++ b/X11/xfreerdp.c
@@ -108,6 +108,7 @@ out_args(void)
"\t-c: directory\n"
"\t-g: geometry, using format WxH or X%, default is 1024x768\n"
"\t-t: alternative port number, default is 3389\n"
+ "\t-T: set window title\n"
"\t-n: hostname\n"
"\t-o: console audio\n"
"\t-0: console session\n"
@@ -310,6 +311,18 @@ process_params(xfInfo * xfi, int argc, char ** argv, int * pindex)
}
settings->tcp_port_rdp = atoi(argv[*pindex]);
}
+ else if (strcmp("-T", argv[*pindex]) == 0)
+ {
+ *pindex = *pindex + 1;
+ if (*pindex == argc)
+ {
+ printf("missing window title\n");
+ exit(XF_EXIT_WRONG_PARAM);
+ }
+ strncpy(settings->window_title, argv[*pindex], sizeof(settings->window_title) - 1);
+ settings->window_title[sizeof(settings->window_title) - 1] = 0;
+ }
+
else if (strcmp("-n", argv[*pindex]) == 0)
{
*pindex = *pindex + 1;
diff --git a/include/freerdp/rdpset.h b/include/freerdp/rdpset.h
index ddbce34..a0a04f1 100644
--- a/include/freerdp/rdpset.h
+++ b/include/freerdp/rdpset.h
@@ -45,6 +45,7 @@ struct rdp_set
char shell[256];
char directory[256];
char username[256];
+ char window_title[64];
int tcp_port_rdp;
int keyboard_layout;
int keyboard_type;
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel