summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2020-11-15 02:41:36 +0100
committerStefan Kangas <stefan@marxist.se>2020-11-15 02:41:36 +0100
commit36431e16799872e84161d46e66057b05289a1335 (patch)
tree5caa4fbe25308c9949e84c69e7e162abedb32f3e /src/xterm.c
parentf08e6538dca6d9cd1457ba1129afe1e56ee286f4 (diff)
downloademacs-36431e16799872e84161d46e66057b05289a1335.tar.gz
Make initial frame match frame-title-format
* src/xterm.c (x_term_init): * src/w32term.c (w32_initialize_display_info): Sync initial frame title with new value of Vframe_title_format. Problem reported by Angelo Graziosi <angelo.g0@libero.it>.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 98bb0ea8917..0d2452de929 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12928,19 +12928,23 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
#endif
Lisp_Object system_name = Fsystem_name ();
-
- ptrdiff_t nbytes = SBYTES (Vinvocation_name) + 1;
- if (STRINGP (system_name)
- && INT_ADD_WRAPV (nbytes, SBYTES (system_name) + 1, &nbytes))
- memory_full (SIZE_MAX);
- dpyinfo->x_id = ++x_display_id;
- dpyinfo->x_id_name = xmalloc (nbytes);
- char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name);
+ static char const title[] = "GNU Emacs";
if (STRINGP (system_name))
{
- *nametail++ = '@';
- lispstpcpy (nametail, system_name);
+ static char const at[] = " at ";
+ ptrdiff_t nbytes = sizeof (title) + sizeof (at);
+ if (INT_ADD_WRAPV (nbytes, SBYTES (system_name), &nbytes))
+ memory_full (SIZE_MAX);
+ dpyinfo->x_id_name = xmalloc (nbytes);
+ sprintf (dpyinfo->x_id_name, "%s%s%s", title, at, SDATA (system_name));
}
+ else
+ {
+ dpyinfo->x_id_name = xmalloc (sizeof (title));
+ strcpy (dpyinfo->x_id_name, title);
+ }
+
+ dpyinfo->x_id = ++x_display_id;
/* Figure out which modifier bits mean what. */
x_find_modifier_meanings (dpyinfo);