From f0f1f9c2f04fb0e331a32343ab6ef6be39552cf6 Mon Sep 17 00:00:00 2001 From: Stefan Schippers Date: Fri, 16 Oct 2020 18:24:06 +0200 Subject: [PATCH] optimization in preview function: no un-needed redraw of current schematic; no window title change when previewing xschem files --- src/save.c | 2 +- src/token.c | 4 ++-- src/xinit.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/save.c b/src/save.c index 8da44eef..c0a914ba 100644 --- a/src/save.c +++ b/src/save.c @@ -1037,7 +1037,7 @@ void load_schematic(int load_symbols, const char *filename, int reset_undo) /* 2 my_strncpy(xctx->current_name, name, S(xctx->current_name)); } if(has_x) { /* 20161207 moved after if( (fd=..)) */ - if(strcmp(get_cell(xctx->sch[xctx->currsch],1), "systemlib/font")) { + if(reset_undo) { tcleval( "wm title . \"xschem - [file tail [xschem get schname]]\""); /* 20150417 set window and icon title */ tcleval( "wm iconname . \"xschem - [file tail [xschem get schname]]\""); } diff --git a/src/token.c b/src/token.c index 7274ab7f..e25372e1 100644 --- a/src/token.c +++ b/src/token.c @@ -465,9 +465,9 @@ const char *get_tok_value(const char *s,const char *tok, int with_quotes) static char *token=NULL; int size=0; int sizetok=0; - register int c, state=XBEGIN, space; + register int c, space; register int token_pos=0, value_pos=0; - int quote=0; + int quote=0, state=XBEGIN; int escape=0; int cmp = 1; diff --git a/src/xinit.c b/src/xinit.c index 139e179d..b9174dee 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -840,7 +840,7 @@ void preview_window(const char *what, const char *tk_win_path, const char *filen window = save_window; resetwin(); change_linewidth(-1.); - draw(); + /* draw(); */ /* not needed: event loop takes care of this. */ event_reporting = save_ev; } else if(!strcmp(what, "destroy")) {