From 31a0712109ddbaa323b25b9f019dddca1a9c91d4 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sun, 23 Mar 2025 12:16:01 +0100 Subject: [PATCH] remove some redundant operations (housekeeping_ctx) when switching windows contexts for redraw_only --- src/callback.c | 3 ++- src/xinit.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/callback.c b/src/callback.c index b968024c..a25d5a90 100644 --- a/src/callback.c +++ b/src/callback.c @@ -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 diff --git a/src/xinit.c b/src/xinit.c index d85ef416..3d325f59 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -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;