fix XK_ISO_Left_Tab to compile on windows; initialize framewin_child_ptr pointers to NULL, and remove extra slash from " in test_backannotated_subckt.sch so it wont seg fault on Windows.

This commit is contained in:
stefan schippers 2026-02-18 08:55:14 +01:00
parent 0c1f844e62
commit a8573a1c62
3 changed files with 23 additions and 6 deletions

View File

@ -3857,8 +3857,24 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
new_schematic("switch", "previous", "", 1);
xctx->semaphore = save;
}
#ifndef __unix__
else if(state == ShiftMask) {
int save = xctx->semaphore;
if(xctx->semaphore >= 2) break;
xctx->semaphore = 0;
tcleval("next_tab");
xctx->semaphore = save;
}
else if(state == (ControlMask | ShiftMask)) {
int save = xctx->semaphore;
if(xctx->semaphore >= 2) break;
xctx->semaphore = 0;
tcleval("prev_tab");
xctx->semaphore = save;
}
#endif
break;
#ifdef __unix__
case XK_ISO_Left_Tab: /* Shift is pressed */
if(state == (ControlMask | ShiftMask)) {
int save = xctx->semaphore;
@ -3876,7 +3892,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
}
break;
#endif
case XK_Right:
if(state == ControlMask) {
int save = xctx->semaphore;

View File

@ -210,7 +210,7 @@ void windowid(const char *win_path)
unsigned int ww;
Window framewin, rootwindow, parent_of_topwindow;
Window *framewin_child_ptr;
Window *framewin_child_ptr=NULL;
unsigned int framewindow_nchildren;
dbg(1, "windowid(): win_path=%s\n", win_path);
@ -228,7 +228,8 @@ void windowid(const char *win_path)
if (framewindow_nchildren==0) fprintf(errfp, "no framewin child\n");
else fprintf(errfp, "framewin child 0=%x\n", (unsigned int)framewin_child_ptr[0]);
}
XFree(framewin_child_ptr);
if (framewin_child_ptr!=NULL)
XFree(framewin_child_ptr);
/* here I create the icon pixmap,to be used when iconified, */
#ifdef __unix__
if(!cad_icon_pixmap) {
@ -1132,7 +1133,7 @@ void toggle_fullscreen(const char *topwin)
char normal[]="remove,fullscreen";
unsigned int topwin_id;
Window rootwindow, parent_id;
Window *framewin_child_ptr;
Window *framewin_child_ptr=NULL;
unsigned int framewindow_nchildren;
int fs;
char *toplevel = (xctx->top_path[0] ? xctx->top_path : ".");

View File

@ -74,7 +74,7 @@ if \{ [info commands calc_rc] eq \{\} \} \{
proc calc_rc \{ L W \} \{
if \{[catch \{expr 1200*$L/$W\} res]\} \{set res -1\}
if \{[catch \{expr 1e-3*$W*$L\} cap]\} \{set cap -1\}
return \\"Res=$res Cap=$cap\\"
return \"Res=$res Cap=$cap\"
\}
puts [info body calc_rc]
puts \{############\}