diff --git a/src/xinit.c b/src/xinit.c index 9ae4c94e..3f170cb6 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1713,6 +1713,8 @@ static void create_new_window(int *window_count, const char *win_path, const cha xctx->xorigin=CADINITIALX; xctx->yorigin=CADINITIALY; load_schematic(1, fname, 1, confirm); + if(dr) xctx->pending_fullzoom=1; + tclvareval("set_bindings ", window_path[n], NULL); if(has_x) { tclvareval("set_geom ", toppath, " [xschem get schname]", NULL); } @@ -1726,10 +1728,7 @@ static void create_new_window(int *window_count, const char *win_path, const cha * new_schematic("switch", prev_window, "", 1); */ tclvareval("housekeeping_ctx", NULL); - tclvareval("set_bindings ", window_path[n], NULL); if(has_x) windowid(toppath); - if(dr) xctx->pending_fullzoom=1; - if(has_x) tclvareval("tkwait visibility ", toppath, ".drw", NULL); } /* non NULL and not empty noconfirm is used to avoid warning for duplicated filenames */ @@ -3146,10 +3145,11 @@ int Tcl_AppInit(Tcl_Interp *inter) if(!file_loaded) tcleval("exit 1"); if(cli_opt_do_netlist) set_modify(-1); /* set tab/window title */ } - if(has_x) tclvareval("set_geom . [xschem get schname]", NULL); - tcleval("set_bindings .drw"); - /* Necessary to tell xschem the initial area to display */ xctx->pending_fullzoom=1; + tcleval("set_bindings .drw"); + if(has_x) tclvareval("set_geom . [xschem get schname]", NULL); + /* Necessary to tell xschem the initial area to display */ + if(cli_opt_do_netlist) { if(!cli_opt_filename[0]) { fprintf(errfp, "xschem: cant do a netlist without a filename\n"); diff --git a/src/xschem.tcl b/src/xschem.tcl index 828fda89..09547c58 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -8539,7 +8539,7 @@ proc set_geom {win {filename {}}} { set xmax [winfo screenwidth .] set ymax [winfo screenheight .] scan $ret {%dx%d+%d+%d} x y dx dy - puts "xmax=$xmax, ymax=$ymax, x=$x, y=$y dx=$dx dy=$dy" + # puts "xmax=$xmax, ymax=$ymax, x=$x, y=$y dx=$dx dy=$dy" # off screen. do not use. if { $dx > $xmax - 100 || $dy > $ymax - 100} { set ret {} @@ -8551,6 +8551,8 @@ proc set_geom {win {filename {}}} { wm geometry $win $initial_geometry # puts "set to geometry: $initial_geometry" } + # tkwait visibility $win + update } proc get_geom {win {filename {}}} {