char *platform_default_s(const char *name)
{
+ if (!strcmp(name, "SerialLine"))
+ return dupstr("/dev/ttyS0");
return NULL;
}
if (inst->cfg.nethack_keypad) {
char *keys = NULL;
switch (event->keyval) {
- case GDK_KP_1: case GDK_KP_End: keys = "bB"; break;
- case GDK_KP_2: case GDK_KP_Down: keys = "jJ"; break;
- case GDK_KP_3: case GDK_KP_Page_Down: keys = "nN"; break;
- case GDK_KP_4: case GDK_KP_Left: keys = "hH"; break;
- case GDK_KP_5: case GDK_KP_Begin: keys = ".."; break;
- case GDK_KP_6: case GDK_KP_Right: keys = "lL"; break;
- case GDK_KP_7: case GDK_KP_Home: keys = "yY"; break;
- case GDK_KP_8: case GDK_KP_Up: keys = "kK"; break;
- case GDK_KP_9: case GDK_KP_Page_Up: keys = "uU"; break;
+ case GDK_KP_1: case GDK_KP_End: keys = "bB\002"; break;
+ case GDK_KP_2: case GDK_KP_Down: keys = "jJ\012"; break;
+ case GDK_KP_3: case GDK_KP_Page_Down: keys = "nN\016"; break;
+ case GDK_KP_4: case GDK_KP_Left: keys = "hH\010"; break;
+ case GDK_KP_5: case GDK_KP_Begin: keys = "..."; break;
+ case GDK_KP_6: case GDK_KP_Right: keys = "lL\014"; break;
+ case GDK_KP_7: case GDK_KP_Home: keys = "yY\031"; break;
+ case GDK_KP_8: case GDK_KP_Up: keys = "kK\013"; break;
+ case GDK_KP_9: case GDK_KP_Page_Up: keys = "uU\025"; break;
}
if (keys) {
end = 2;
- if (event->state & GDK_SHIFT_MASK)
+ if (event->state & GDK_CONTROL_MASK)
+ output[1] = keys[2];
+ else if (event->state & GDK_SHIFT_MASK)
output[1] = keys[1];
else
output[1] = keys[0];
if (n > NALLCOLOURS)
return;
real_palette_set(inst, n, r, g, b);
- if (n == 258)
+ if (n == 258) {
+ /* Default Background changed. Ensure space between text area and
+ * window border is redrawn */
set_window_background(inst);
+ draw_backing_rect(inst);
+ gtk_widget_queue_draw(inst->area);
+ }
}
void palette_reset(void *frontend)
inst->cfg.colours[i][1], inst->cfg.colours[i][2]);
}
+ /* Since Default Background may have changed, ensure that space
+ * between text area and window border is refreshed. */
set_window_background(inst);
+ if (inst->area) {
+ draw_backing_rect(inst);
+ gtk_widget_queue_draw(inst->area);
+ }
}
/* Ensure that all the cut buffers exist - according to the ICCCM, we must
return ptr;
}
-void write_clip(void *frontend, wchar_t * data, int len, int must_deselect)
+void write_clip(void *frontend, wchar_t * data, int *attr, int len, int must_deselect)
{
struct gui_data *inst = (struct gui_data *)frontend;
if (inst->pasteout_data)
* may want to perform additional actions on any kind of bell (for
* example, taskbar flashing in Windows).
*/
-void beep(void *frontend, int mode)
+void do_beep(void *frontend, int mode)
{
if (mode != BELL_VISUAL)
gdk_beep();
wcs[i] = text[i];
}
+ if (inst->fonts[fontid] == NULL && (fontid & 2)) {
+ /*
+ * We've been given ATTR_WIDE, but have no wide font.
+ * Fall back to the non-wide font.
+ */
+ fontid &= ~2;
+ }
+
if (inst->fonts[fontid] == NULL) {
/*
- * The font for this contingency does not exist.
- * Typically this means we've been given ATTR_WIDE
- * character and have no wide font. So we display
- * nothing at all; such is life.
+ * The font for this contingency does not exist. So we
+ * display nothing at all; such is life.
*/
} else if (inst->fontinfo[fontid].is_wide) {
/*
void reset_terminal_menuitem(GtkMenuItem *item, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
- term_pwron(inst->term);
+ term_pwron(inst->term, TRUE);
if (inst->ldisc)
ldisc_send(inst->ldisc, NULL, 0, 0);
}
if (!inst->back) {
logevent(inst, "----- Session restarted -----");
+ term_pwron(inst->term, FALSE);
start_backend(inst);
inst->exited = FALSE;
}
set_icon(inst, title);
sfree(title);
}
+ sfree(realhost);
+
inst->back->provide_logctx(inst->backhandle, inst->logctx);
term_provide_resize_fn(inst->term, inst->back->size, inst->backhandle);
cmdline_run_saved(&inst->cfg);
- if (!*inst->cfg.host && !cfgbox(&inst->cfg))
+ if (!cfg_launchable(&inst->cfg) && !cfgbox(&inst->cfg))
exit(0); /* config box hit Cancel */
}