allow "xschem switch" also if started without X

This commit is contained in:
stefan schippers 2025-09-26 12:59:38 +02:00
parent 921dcdd506
commit a77a10523d
1 changed files with 2 additions and 2 deletions

View File

@ -1554,7 +1554,7 @@ static int switch_window(int *window_count, const char *win_path, int tcl_ctx)
}
}
/* if window was closed then tkwin == 0 --> do nothing */
if(tkwin && n >= 0 && n < MAX_NEW_WINDOWS) {
if((!has_x || (tkwin && has_x)) && n >= 0 && n < MAX_NEW_WINDOWS) {
if(tcl_ctx) tclvareval("save_ctx ", xctx->current_win_path, NULL);
xctx = save_xctx[n];
@ -1629,7 +1629,7 @@ static void create_new_window(int *window_count, const char *win_path, const cha
char prev_window[WINDOW_PATH_SIZE];
int i, n, confirm = 1;
dbg(1, "new_schematic() create: fname=%s *window_count = %d\n", fname, *window_count);
dbg(0, "new_schematic() create: fname=%s *window_count = %d\n", fname, *window_count);
if(win_path && win_path[0]) confirm = 0;
my_strncpy(prev_window, xctx->current_win_path, S(prev_window));