1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Merge out from trunk, to keep this branch viable. We are now up to

date as of r7913.

[originally from svn r7914]
[r7913 == d7eda6d99c]
This commit is contained in:
Simon Tatham
2008-03-10 18:48:36 +00:00
81 changed files with 2085 additions and 933 deletions

View File

@ -663,13 +663,12 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
end = 2;
}
/* Control-Break is the same as Control-C */
/* Control-Break sends a Break special to the backend */
if (event->keyval == GDK_Break &&
(event->state & GDK_CONTROL_MASK)) {
output[1] = '\003';
use_ucsoutput = FALSE;
end = 2;
special = TRUE;
if (inst->back)
inst->back->special(inst->backhandle, TS_BRK);
return TRUE;
}
/* We handle Return ourselves, because it needs to be flagged as
@ -724,6 +723,13 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
end = 1 + sprintf(output+1, "\033[Z");
use_ucsoutput = FALSE;
}
/* And normal Tab is Tab, if the keymap hasn't already told us.
* (Curiously, at least one version of the MacOS 10.5 X server
* doesn't translate Tab for us. */
if (event->keyval == GDK_Tab && end <= 1) {
output[1] = '\t';
end = 2;
}
/*
* NetHack keypad mode.
@ -1431,7 +1437,7 @@ void palette_reset(void *frontend)
int r = i / 36, g = (i / 6) % 6, b = i % 6;
inst->cols[i+16].red = r ? r * 0x2828 + 0x3737 : 0;
inst->cols[i+16].green = g ? g * 0x2828 + 0x3737 : 0;
inst->cols[i+16].blue = b ? b + 0x2828 + 0x3737 : 0;
inst->cols[i+16].blue = b ? b * 0x2828 + 0x3737 : 0;
} else {
int shade = i - 216;
shade = shade * 0x0a0a + 0x0808;
@ -1864,7 +1870,7 @@ void sys_cursor(void *frontend, int x, int y)
*/
void do_beep(void *frontend, int mode)
{
if (mode != BELL_VISUAL)
if (mode == BELL_DEFAULT)
gdk_beep();
}
@ -2408,7 +2414,7 @@ static void help(FILE *fp) {
}
}
int do_cmdline(int argc, char **argv, int do_everything,
int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
struct gui_data *inst, Config *cfg)
{
int err = 0;
@ -2614,7 +2620,8 @@ int do_cmdline(int argc, char **argv, int do_everything,
exit(1);
} else if(p[0] != '-' && (!do_everything ||
process_nonoption_arg(p, cfg))) {
process_nonoption_arg(p, cfg,
allow_launch))) {
/* do nothing */
} else {
@ -3321,6 +3328,7 @@ void set_window_icon(GtkWidget *window, const char *const *const *icon,
int n_icon)
{
GdkPixmap *iconpm;
GdkBitmap *iconmask;
#if GTK_CHECK_VERSION(2,0,0)
GList *iconlist;
int n;
@ -3330,9 +3338,9 @@ void set_window_icon(GtkWidget *window, const char *const *const *icon,
return;
gtk_widget_realize(window);
iconpm = gdk_pixmap_create_from_xpm_d(window->window, NULL,
iconpm = gdk_pixmap_create_from_xpm_d(window->window, &iconmask,
NULL, (gchar **)icon[0]);
gdk_window_set_icon(window->window, NULL, iconpm, NULL);
gdk_window_set_icon(window->window, NULL, iconpm, iconmask);
#if GTK_CHECK_VERSION(2,0,0)
iconlist = NULL;
@ -3492,15 +3500,23 @@ int pt_main(int argc, char **argv)
/* Splatter this argument so it doesn't clutter a ps listing */
memset(argv[1], 0, strlen(argv[1]));
} else {
if (do_cmdline(argc, argv, 0, inst, &inst->cfg))
/* By default, we bring up the config dialog, rather than launching
* a session. This gets set to TRUE if something happens to change
* that (e.g., a hostname is specified on the command-line). */
int allow_launch = FALSE;
if (do_cmdline(argc, argv, 0, &allow_launch, inst, &inst->cfg))
exit(1); /* pre-defaults pass to get -class */
do_defaults(NULL, &inst->cfg);
if (do_cmdline(argc, argv, 1, inst, &inst->cfg))
if (do_cmdline(argc, argv, 1, &allow_launch, inst, &inst->cfg))
exit(1); /* post-defaults, do everything */
cmdline_run_saved(&inst->cfg);
if (!cfg_launchable(&inst->cfg) && !cfgbox(&inst->cfg))
if (loaded_session)
allow_launch = TRUE;
if ((!allow_launch || !cfg_launchable(&inst->cfg)) &&
!cfgbox(&inst->cfg))
exit(0); /* config box hit Cancel */
}