{
if (!strcmp(name, "CloseOnExit"))
return 2; /* maps to FORCE_ON after painful rearrangement :-( */
+ if (!strcmp(name, "WinNameAlways"))
+ return 0; /* X natively supports icon titles, so use 'em by default */
return def;
}
/* By default, nothing is generated. */
end = start = 0;
+ special = FALSE;
/*
* If Alt is being released after typing an Alt+numberpad
}
}
+static void set_window_titles(struct gui_data *inst)
+{
+ /*
+ * We must always call set_icon_name after calling set_title,
+ * since set_title will write both names. Irritating, but such
+ * is life.
+ */
+ gtk_window_set_title(GTK_WINDOW(inst->window), inst->wintitle);
+ if (!inst->cfg.win_name_always)
+ gdk_window_set_icon_name(inst->window->window, inst->icontitle);
+}
+
void set_title(void *frontend, char *title)
{
struct gui_data *inst = (struct gui_data *)frontend;
strncpy(inst->wintitle, title, lenof(inst->wintitle));
inst->wintitle[lenof(inst->wintitle)-1] = '\0';
- gtk_window_set_title(GTK_WINDOW(inst->window), inst->wintitle);
+ set_window_titles(inst);
}
void set_icon(void *frontend, char *title)
struct gui_data *inst = (struct gui_data *)frontend;
strncpy(inst->icontitle, title, lenof(inst->icontitle));
inst->icontitle[lenof(inst->icontitle)-1] = '\0';
- gdk_window_set_icon_name(inst->window->window, inst->icontitle);
+ set_window_titles(inst);
}
void set_sbar(void *frontend, int total, int start, int page)
inst->font_height = inst->fonts[0]->ascent + inst->fonts[0]->descent;
inst->direct_to_font = init_ucs(&inst->ucsdata,
- inst->cfg.line_codepage, font_charset);
+ inst->cfg.line_codepage, font_charset,
+ inst->cfg.vtmode);
}
void set_geom_hints(struct gui_data *inst)
*/
if (strcmp(oldcfg.wintitle, cfg2.wintitle))
set_title(inst, cfg2.wintitle);
+ set_window_titles(inst);
/*
* Redo the whole tangled fonts and Unicode mess if
strcmp(oldcfg.boldfont.name, cfg2.boldfont.name) ||
strcmp(oldcfg.widefont.name, cfg2.widefont.name) ||
strcmp(oldcfg.wideboldfont.name, cfg2.wideboldfont.name) ||
- strcmp(oldcfg.line_codepage, cfg2.line_codepage)) {
+ strcmp(oldcfg.line_codepage, cfg2.line_codepage) ||
+ oldcfg.vtmode != cfg2.vtmode) {
setup_fonts_ucs(inst);
need_size = 1;
} else
fork_and_exec_self(inst, pipefd[1], option, NULL);
close(pipefd[0]);
- i = 0;
+ i = ret = 0;
while (i < size && (ret = write(pipefd[1], data + i, size - i)) > 0)
i += ret;
if (ret < 0)
}
data = snewn(size, char);
- i = 0;
+ i = ret = 0;
while (i < size && (ret = read(fd, data + i, size - i)) > 0)
i += ret;
if (ret < 0) {
* it */
block_signal(SIGCHLD, 1);
- /*
- * SIGPIPE is not something we want to see terminating the
- * process.
- */
- block_signal(SIGPIPE, 1);
-
inst->progname = argv[0];
/*
* Copy the original argv before letting gtk_init fiddle with
return 0;
}
- if (inst->cfg.wintitle[0])
+ if (inst->cfg.wintitle[0]) {
set_title(inst, inst->cfg.wintitle);
- else {
+ set_icon(inst, inst->cfg.wintitle);
+ } else {
char *title = make_default_wintitle(realhost);
set_title(inst, title);
+ set_icon(inst, title);
sfree(title);
}
}
* called */
block_signal(SIGCHLD, 0);
+ /*
+ * Block SIGPIPE: if we attempt Duplicate Session or similar
+ * and it falls over in some way, we certainly don't want
+ * SIGPIPE terminating the main pterm/PuTTY. Note that we do
+ * this _after_ (at least pterm) forks off its child process,
+ * since the child wants SIGPIPE handled in the usual way.
+ */
+ block_signal(SIGPIPE, 1);
+
inst->exited = FALSE;
gtk_main();