diff --git a/src/xinit.c b/src/xinit.c index bba4046f..2d19ad00 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1172,6 +1172,7 @@ void preview_window(const char *what, const char *win_path, const char *fname) } else if(!strcmp(what, "draw")) { dbg(1, "preview_window() draw\n"); + tclvareval("save_ctx ", xctx->current_win_path, NULL); save_xctx = xctx; /* save current schematic */ xctx = preview_xctx; if(!current_file || strcmp(fname, current_file) ) { @@ -1206,6 +1207,7 @@ void preview_window(const char *what, const char *win_path, const char *fname) Tk_DestroyWindow(tkpre_window); my_free(_ALLOC_ID_, ¤t_file); xctx = save_xctx; /* restore schematic */ + tclvareval("restore_ctx ", xctx->current_win_path, NULL); save_xctx = NULL; set_modify(-1); }