in saved sessions, so that a programmable window manager can
distinguish different PuTTYs/pterms on startup and assign them
different window management properties.
git-svn-id: svn://svn.tartarus.org/sgt/putty@9078
cda61777-01e9-0310-a592-
d414129be87e
FontSpec wideboldfont;
int shadowboldoffset;
int crhaslf;
+ char winclass[256];
};
/*
write_setting_i(sesskey, "SerialStopHalfbits", cfg->serstopbits);
write_setting_i(sesskey, "SerialParity", cfg->serparity);
write_setting_i(sesskey, "SerialFlowControl", cfg->serflow);
+ write_setting_s(sesskey, "WindowClass", cfg->winclass);
}
void load_settings(char *section, Config * cfg)
gppi(sesskey, "SerialStopHalfbits", 2, &cfg->serstopbits);
gppi(sesskey, "SerialParity", SER_PAR_NONE, &cfg->serparity);
gppi(sesskey, "SerialFlowControl", SER_FLOW_XONXOFF, &cfg->serflow);
+ gpps(sesskey, "WindowClass", "", cfg->winclass, sizeof(cfg->winclass));
}
void do_defaults(char *session, Config * cfg)
HELPCTX(translation_utf8_override),
dlg_stdcheckbox_handler,
I(offsetof(Config,utf8_override)));
+
+ if (!midsession) {
+ /*
+ * Allow the user to specify the window class as part of the saved
+ * configuration, so that they can have their window manager treat
+ * different kinds of PuTTY and pterm differently if they want to.
+ */
+ s = ctrl_getset(b, "Window/Behaviour", "x11",
+ "X Window System settings");
+ ctrl_editbox(s, "Window class name:", 'z', 50,
+ HELPCTX(no_help), dlg_stdeditbox_handler,
+ I(offsetof(Config,winclass)),
+ I(sizeof(((Config *)0)->winclass)));
+ }
}
init_cutbuffers();
inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ if (inst->cfg.winclass[0])
+ gtk_window_set_wmclass(GTK_WINDOW(inst->window),
+ inst->cfg.winclass, inst->cfg.winclass);
/*
* Set up the colour map.