From 2561014b75544cabaf8806cd36f879e01bc7dc3e Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sun, 3 Mar 2024 04:47:02 +0100 Subject: [PATCH] fix a missing return in drawbezier when called for cleanup, add a filter for $has_x before applying option instructions in xschem.tcl --- src/draw.c | 1 + src/xschem.tcl | 56 ++++++++++++++++++++++++++------------------------ 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/draw.c b/src/draw.c index 7bf1b31b..8c7949a2 100644 --- a/src/draw.c +++ b/src/draw.c @@ -1674,6 +1674,7 @@ void drawbezier(Drawable w, GC gc, int c, double *x, double *y, int points, int if(points == 0 && x == NULL && y == NULL) { /* cleanup */ my_free(_ALLOC_ID_, &p); + return; } if(!p) p = my_malloc(_ALLOC_ID_, psize * sizeof(XPoint)); i = 0; diff --git a/src/xschem.tcl b/src/xschem.tcl index 2d2db961..1e13de72 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -8153,34 +8153,36 @@ proc setup_tcp_bespice {} { ### set_ne dark_colorscheme 1 set_ne dark_gui_colorscheme 0 -if { $dark_gui_colorscheme == 0 } { ;# normal GUI - option add *foreground black startupFile - option add *activeForeground black startupFile - option add *background {#d9d9d9} startupFile - option add *activeBackground {#ececec} startupFile - option add *disabledForeground {black} startupFile - option add *disabledBackground {#d9d9d9} startupFile - option add *readonlyBackground {#d9d9d9} startupFile - option add *highlightBackground {#d9d9d9} startupFile - option add *highlightThickness 0 startupFile - option add *highlightColor {grey30} startupFile - option add *insertBackground {black} startupFile - option add *selectColor {white} startupFile -} else { ;# dark GUI colorscheme - option add *foreground white startupFile - option add *activeForeground white startupFile - option add *background {grey20} startupFile - option add *activeBackground {grey20} startupFile - option add *disabledForeground {white} startupFile - option add *disabledBackground {grey20} startupFile - option add *readonlyBackground {grey20} startupFile - option add *highlightBackground {grey20} startupFile - option add *highlightThickness 0 startupFile - option add *highlightColor {grey70} startupFile - option add *insertBackground {white} startupFile - option add *selectColor {black} startupFile -} +if { [info exists has_x]} { + if { $dark_gui_colorscheme == 0 } { ;# normal GUI + option add *foreground black startupFile + option add *activeForeground black startupFile + option add *background {#d9d9d9} startupFile + option add *activeBackground {#ececec} startupFile + option add *disabledForeground {black} startupFile + option add *disabledBackground {#d9d9d9} startupFile + option add *readonlyBackground {#d9d9d9} startupFile + option add *highlightBackground {#d9d9d9} startupFile + option add *highlightThickness 0 startupFile + option add *highlightColor {grey30} startupFile + option add *insertBackground {black} startupFile + option add *selectColor {white} startupFile + } else { ;# dark GUI colorscheme + option add *foreground white startupFile + option add *activeForeground white startupFile + option add *background {grey20} startupFile + option add *activeBackground {grey20} startupFile + option add *disabledForeground {white} startupFile + option add *disabledBackground {grey20} startupFile + option add *readonlyBackground {grey20} startupFile + option add *highlightBackground {grey20} startupFile + option add *highlightThickness 0 startupFile + option add *highlightColor {grey70} startupFile + option add *insertBackground {white} startupFile + option add *selectColor {black} startupFile + } +} set OS [lindex $tcl_platform(os) 0] set env(LC_ALL) C # tcl variable XSCHEM_LIBRARY_PATH should already be set in xschemrc