diff --git a/src/xinit.c b/src/xinit.c index 9dac8045..f78e7903 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1686,7 +1686,7 @@ static void create_new_window(int *window_count, const char *win_path, const cha } if(has_x) { tclvareval("toplevel ", toppath, " -bg {} -width 400 -height 400 -takefocus 0", NULL); - tclvareval("set_geom ", toppath, " [abs_sym_path {", fname, "}]", NULL); + tclvareval("set_geom ", toppath, " [abs_sym_path {", fname ? fname : "untitled.sch", "}]", NULL); tclvareval("build_widgets ", toppath, NULL); tclvareval("pack_widgets ", toppath, NULL); Tk_MakeWindowExist(Tk_NameToWindow(interp, window_path[n], mainwindow)); @@ -3224,6 +3224,9 @@ int Tcl_AppInit(Tcl_Interp *inter) /* */ tcleval("update; eval_user_startup_commands"); + /* set icon */ + if(has_x) windowid("."); + /* source tcl file given on command line with --script */ if(cli_opt_tcl_script[0]) { /* can not use tclvareval() here because if script contains 'exit' diff --git a/src/xschem.tcl b/src/xschem.tcl index df15c45f..6a3eac59 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -10609,7 +10609,7 @@ if { ( $OS== "Windows" || [string length [lindex [array get env DISPLAY] 1] ] > set_replace_key_binding # update - xschem windowid . ;# set icon for window + # xschem windowid . ;# set icon for window } ;# end if {[exists has_x]} # read custom colors