From e8d29c9b422a581b5897ab16580dab7cec830611 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 27 Sep 2025 01:02:36 +0200 Subject: [PATCH] avoid context switching when opening a new window until new window creation finished (use xctx->pending_fullzoom) --- src/callback.c | 4 +++- src/xinit.c | 2 +- src/xschem.tcl | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/callback.c b/src/callback.c index ee7953d0..dd8acf55 100644 --- a/src/callback.c +++ b/src/callback.c @@ -4575,6 +4575,8 @@ static int handle_window_switching(int event, int tabbed_interface, const char * if((event == FocusIn || event == Expose || event == EnterNotify) && strcmp(xctx->current_win_path, win_path) ) { struct stat buf; + + if(xctx->pending_fullzoom == 1) return 0; /* no switching if opening a new window */ dbg(1, "handle_window_switching(): event=%d, ui_state=%d win_path=%s\n", event, xctx->ui_state, win_path); /* This will switch context only when copying stuff across windows @@ -4729,7 +4731,7 @@ int callback(const char *win_path, int event, int mx, int my, KeySym key, int bu break; case ConfigureNotify: - dbg(1,"callback(): ConfigureNotify event: %s\n", win_path); + dbg(1,"callback(): ConfigureNotify event: %s %dx%d\n", win_path, button, aux); resetwin(1, 1, 0, 0, 0); draw(); break; diff --git a/src/xinit.c b/src/xinit.c index b61cace8..d70493b5 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -2272,7 +2272,7 @@ void resetwin(int create_pixmap, int clear_pixmap, int force, int w, int h) #else XWindowAttributes wattr; #endif - dbg(1, "resetwin(): create=%d, clear=%d, force=%d, w=%d, h=%d\n", + dbg(1, "\nresetwin(): create=%d, clear=%d, force=%d, w=%d, h=%d\n", create_pixmap, clear_pixmap, force, w, h); if(w && h) { width = w; diff --git a/src/xschem.tcl b/src/xschem.tcl index 5b350d6d..b5e8bdd6 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -8552,6 +8552,7 @@ proc set_geom {win {filename {}}} { } } if {$geom ne {}} { + # puts "set_geom: setting geometry of $win to $geom" wm geometry $win $geom update }