summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4ca761b)
not redrawn when the window background colour is reconfigured mid-
session. In addition, the Official Window Background is not reset,
meaning that opaque resizes etc will flicker in the old background
colour. This checkin should fix both.
git-svn-id: svn://svn.tartarus.org/sgt/putty@3190
cda61777-01e9-0310-a592-
d414129be87e
inst->mouseptr_visible = show;
}
inst->mouseptr_visible = show;
}
+void draw_backing_rect(struct gui_data *inst)
+{
+ GdkGC *gc = gdk_gc_new(inst->area->window);
+ gdk_gc_set_foreground(gc, &inst->cols[18]); /* default background */
+ gdk_draw_rectangle(inst->pixmap, gc, 1, 0, 0,
+ inst->cfg.width * inst->font_width + 2*inst->cfg.window_border,
+ inst->cfg.height * inst->font_height + 2*inst->cfg.window_border);
+ gdk_gc_unref(gc);
+}
+
gint configure_area(GtkWidget *widget, GdkEventConfigure *event, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
int w, h, need_size = 0;
gint configure_area(GtkWidget *widget, GdkEventConfigure *event, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
int w, h, need_size = 0;
/*
* See if the terminal size has changed, in which case we must
/*
* See if the terminal size has changed, in which case we must
(inst->cfg.height * inst->font_height +
2*inst->cfg.window_border), -1);
(inst->cfg.height * inst->font_height +
2*inst->cfg.window_border), -1);
- gc = gdk_gc_new(inst->area->window);
- gdk_gc_set_foreground(gc, &inst->cols[18]); /* default background */
- gdk_draw_rectangle(inst->pixmap, gc, 1, 0, 0,
- inst->cfg.width * inst->font_width + 2*inst->cfg.window_border,
- inst->cfg.height * inst->font_height + 2*inst->cfg.window_border);
- gdk_gc_unref(gc);
+ draw_backing_rect(inst);
if (need_size && inst->term) {
term_size(inst->term, h, w, inst->cfg.savelines);
if (need_size && inst->term) {
term_size(inst->term, h, w, inst->cfg.savelines);
for (i = 0; i < NCOLOURS; i++) {
if (oldcfg.colours[ww[i]][0] != cfg2.colours[ww[i]][0] ||
oldcfg.colours[ww[i]][1] != cfg2.colours[ww[i]][1] ||
for (i = 0; i < NCOLOURS; i++) {
if (oldcfg.colours[ww[i]][0] != cfg2.colours[ww[i]][0] ||
oldcfg.colours[ww[i]][1] != cfg2.colours[ww[i]][1] ||
- oldcfg.colours[ww[i]][2] != cfg2.colours[ww[i]][2])
+ oldcfg.colours[ww[i]][2] != cfg2.colours[ww[i]][2]) {
real_palette_set(inst, i, cfg2.colours[ww[i]][0],
cfg2.colours[ww[i]][1],
cfg2.colours[ww[i]][2]);
real_palette_set(inst, i, cfg2.colours[ww[i]][0],
cfg2.colours[ww[i]][1],
cfg2.colours[ww[i]][2]);
+
+ /*
+ * If the default background has changed, we must
+ * repaint the space in between the window border
+ * and the text area.
+ */
+ if (i == 18) {
+ set_window_background(inst);
+ draw_backing_rect(inst);
+ }
+ }
}
term_invalidate(inst->term);
}
term_invalidate(inst->term);
+
+ /*
+ * We do an explicit full redraw here to ensure the window
+ * border has been redrawn as well as the text area.
+ */
+ gtk_widget_queue_draw(inst->area);