diff --git a/src/callback.c b/src/callback.c index 54b70767..ee7953d0 100644 --- a/src/callback.c +++ b/src/callback.c @@ -4729,7 +4729,7 @@ int callback(const char *win_path, int event, int mx, int my, KeySym key, int bu break; case ConfigureNotify: - dbg(1,"callback(): ConfigureNotify event\n"); + dbg(1,"callback(): ConfigureNotify event: %s\n", win_path); resetwin(1, 1, 0, 0, 0); draw(); break; diff --git a/src/xinit.c b/src/xinit.c index 2e6e9807..3dfb3c33 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1688,7 +1688,6 @@ static void create_new_window(int *window_count, const char *win_path, const cha tclvareval("toplevel ", toppath, " -bg {} -width 400 -height 400 -takefocus 0", NULL); tclvareval("build_widgets ", toppath, NULL); tclvareval("pack_widgets ", toppath, NULL); - tclvareval("set_geom ", toppath, " [abs_sym_path {", fname ? fname : "untitled.sch", "}]", NULL); Tk_MakeWindowExist(Tk_NameToWindow(interp, window_path[n], mainwindow)); win_id = Tk_WindowId(Tk_NameToWindow(interp, window_path[n], mainwindow)); Tk_ChangeWindowAttributes(Tk_NameToWindow(interp, window_path[n], mainwindow), CWBackingStore, &winattr); @@ -1714,6 +1713,9 @@ 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(has_x) { + tclvareval("set_geom ", toppath, " [abs_sym_path {", fname ? fname : "untitled.sch", "}]", NULL); + } tclvareval("set_replace_key_binding ", window_path[n], NULL); tclvareval("save_ctx ", window_path[n], NULL); tcleval("eval_user_startup_commands"); @@ -1727,6 +1729,7 @@ static void create_new_window(int *window_count, const char *win_path, const cha 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 */