remove some redundant operations (housekeeping_ctx) when switching windows contexts for redraw_only

This commit is contained in:
stefan schippers 2025-03-23 12:16:01 +01:00
parent ed0d71c1ff
commit 31a0712109
2 changed files with 7 additions and 4 deletions

View File

@ -4642,7 +4642,8 @@ int callback(const char *win_path, int event, int mx, int my, KeySym key, int bu
old_win_path, win_path, xctx->semaphore);
new_schematic("switch", win_path, "", 1);
}
tclvareval("housekeeping_ctx", NULL);
/* done in switch_window() */
/* tclvareval("housekeeping_ctx", NULL); */
}
/* artificially set semaphore to allow only redraw operations in switched schematic,
* so we don't need to switch tcl context which is costly performance-wise

View File

@ -1524,11 +1524,13 @@ static int switch_window(int *window_count, const char *win_path, int tcl_ctx)
}
}
/* if window was closed then tkwin == 0 --> do nothing */
if((!has_x || tkwin) && n >= 0 && n < MAX_NEW_WINDOWS) {
if(tkwin && n >= 0 && n < MAX_NEW_WINDOWS) {
if(tcl_ctx) tclvareval("save_ctx ", xctx->current_win_path, NULL);
xctx = save_xctx[n];
if(tcl_ctx) tclvareval("restore_ctx ", win_path, NULL);
tclvareval("housekeeping_ctx", NULL);
if(tcl_ctx) {
tclvareval("restore_ctx ", win_path, NULL);
tclvareval("housekeeping_ctx", NULL);
}
if(tcl_ctx && has_x) tclvareval("reconfigure_layers_button {}", NULL);
set_modify(-1); /* sets window title */
return 0;