do noop if a switch context into itself is called

This commit is contained in:
Stefan Frederik 2022-01-16 00:51:12 +01:00
parent c7b9e8206f
commit abce61655f
1 changed files with 3 additions and 0 deletions

View File

@ -1002,6 +1002,7 @@ static void switch_window(int *window_count, const char *win_path)
{
int i, n;
Tk_Window tkwin;
if(!strcmp(win_path, xctx->current_win_path)) return; /* already there */
if(*window_count) {
dbg(1, "new_schematic(\"switch_win\"...): %s\n", win_path);
tkwin = Tk_NameToWindow(interp, win_path, mainwindow); /* NULL if win_path not existing */
@ -1028,6 +1029,8 @@ static void switch_window(int *window_count, const char *win_path)
static void switch_tab(int *window_count, const char *win_path)
{
int i, n;
if(!strcmp(win_path, xctx->current_win_path)) return; /* already there */
if(*window_count) {
dbg(1, "new_schematic() switch_tab: %s\n", win_path);
n = -1;