followup of previous commit: better set window title when swicthing context

This commit is contained in:
Stefan Frederik 2022-01-10 03:07:57 +01:00
parent 19398e8162
commit a19bdc01a6
2 changed files with 9 additions and 8 deletions

View File

@ -2515,8 +2515,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else if(!strcmp(argv[1],"set_modify"))
{
cmd_found = 1;
if(argc == 3 && argv[2][0] == '0') set_modify(0);
set_modify(1);
if(argc > 2) {
set_modify(atoi(argv[2]));
}
Tcl_ResetResult(interp);
}

View File

@ -948,7 +948,7 @@ void preview_window(const char *what, const char *win_path, const char *filename
my_free(1144, &current_file);
xctx = save_xctx; /* restore schematic */
save_xctx = NULL;
set_modify(xctx->modified);
set_modify(-1);
}
}
@ -1139,7 +1139,7 @@ int new_schematic(const char *what, const char *win_path, const char *filename)
/* following 3 lines must be done also if window not closed */
xctx = savectx; /* restore previous schematic or main window if previous destroyed */
tclvareval("restore_ctx ", xctx->current_win_path, " ; housekeeping_ctx", NULL);
set_modify(xctx->modified); /* sets window title */
set_modify(-1); /* sets window title */
}
/********************** DESTROY_TAB **********************/
} else {
@ -1184,7 +1184,7 @@ int new_schematic(const char *what, const char *win_path, const char *filename)
}
xctx = save_xctx[0]; /* restore main (.drw) schematic */
tclvareval("restore_ctx ", xctx->current_win_path, " ; housekeeping_ctx", NULL);
set_modify(xctx->modified); /* sets window title */
set_modify(-1); /* sets window title */
draw();
}
} else {
@ -1236,7 +1236,7 @@ int new_schematic(const char *what, const char *win_path, const char *filename)
/* following 3 lines must be done also if windows not closed */
xctx = savectx; /* restore previous schematic or main if old is destroyed */
tclvareval("restore_ctx ", xctx->current_win_path, " ; housekeeping_ctx", NULL);
set_modify(xctx->modified); /* sets window title */
set_modify(-1); /* sets window title */
/********************* DESTROY_ALL_TABS ******************/
} else {
Xschem_ctx *savectx;
@ -1275,7 +1275,7 @@ int new_schematic(const char *what, const char *win_path, const char *filename)
/* following 3 lines must be done also if windows not closed */
xctx = savectx; /* restore previous schematic or main if old is destroyed */
tclvareval("restore_ctx ", xctx->current_win_path, " ; housekeeping_ctx", NULL);
set_modify(xctx->modified); /* sets window title */
set_modify(-1); /* sets window title */
}
@ -1300,7 +1300,7 @@ int new_schematic(const char *what, const char *win_path, const char *filename)
/* if window was closed then tkwin == 0 --> do nothing */
if(tkwin && n >= 0 && n < MAX_NEW_WINDOWS) {
xctx = save_xctx[n];
set_modify(xctx->modified); /* sets window title */
set_modify(-1); /* sets window title */
}
}
/********************** SWITCH_TAB **********************/