diff --git a/src/callback.c b/src/callback.c index ac58254e..6dfbdd77 100644 --- a/src/callback.c +++ b/src/callback.c @@ -443,8 +443,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int } if(fabs(xctx->mousex - W_X(cursor1)) < 10) { tclvareval("input_line {Pos:} {xschem set cursor1_x} ", dtoa_eng(xctx->graph_cursor1_x), NULL); + event = 0; /* avoid further processing ButtonPress that might set GRAPHPAH */ } - event = 0; /* avoid further processing ButtonPress that might set GRAPHPAH */ redraw_all_at_end = 1; } @@ -455,8 +455,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int } if(fabs(xctx->mousex - W_X(cursor2)) < 10) { tclvareval("input_line {Pos:} {xschem set cursor2_x} ", dtoa_eng(xctx->graph_cursor2_x), NULL); + event = 0; /* avoid further processing ButtonPress that might set GRAPHPAH */ } - event = 0; /* avoid further processing ButtonPress that might set GRAPHPAH */ redraw_all_at_end = 1; } } diff --git a/src/xinit.c b/src/xinit.c index e3b327fd..8fa7a47a 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -2839,10 +2839,18 @@ int Tcl_AppInit(Tcl_Interp *inter) /* START PROCESSING USER OPTIONS */ /* */ + /* set netlist filename. Set also netlist_dir if a path is given */ + if(cli_opt_initial_netlist_name[0]) { + my_strncpy(xctx->netlist_name, cli_opt_initial_netlist_name, S(cli_opt_initial_netlist_name)); + #ifdef __unix__ + if(strchr(xctx->netlist_name, '/')) { + tclvareval("file dirname ", xctx->netlist_name, NULL); + tclsetvar("netlist_dir", tclresult()); + } + #endif + } /* set tcl netlist_dir if netlist_dir given on cmdline */ if(cli_opt_netlist_dir[0]) tclsetvar("netlist_dir", cli_opt_netlist_dir); - if(cli_opt_initial_netlist_name[0]) - my_strncpy(xctx->netlist_name, cli_opt_initial_netlist_name, S(cli_opt_initial_netlist_name)); enable_layers(); /* prefer using env(PWD) if existing since it does not dereference symlinks */ if(tcleval("info exists env(PWD)")[0] == '1') {