From 52dadcff08bb05406e7c26df3b2b4b699a8504a1 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 30 Jun 2020 16:07:31 -0400 Subject: [PATCH] Modified the "plot svg" command to remove the window trimmings (scrollbar, title bar, etc.) from the output if the command is called from the non-GUI-wrapper environment (where the border area is part of the rendered output). This was required due to an unsolved bug in which calling magic to write SVG output from the wrapper in some pathological case exposed a Tk bug that caused the Tk grid manager to infinite loop, filling memory without limit. --- VERSION | 2 +- plot/plotCmd.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 593d990c..2e217430 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.30 +8.3.31 diff --git a/plot/plotCmd.c b/plot/plotCmd.c index aa710ad0..e77f2480 100644 --- a/plot/plotCmd.c +++ b/plot/plotCmd.c @@ -98,6 +98,7 @@ CmdPlot(w, cmd) int iwidth, scale; #ifdef HAVE_LIBCAIRO + int flags; extern void GrTCairoPlotSVG(); #endif @@ -271,7 +272,13 @@ CmdPlot(w, cmd) cmdPlotOption[PLOTSVG]); return; } + flags = window->w_flags; + /* In case this is called from a non-GUI wrapper window, remove */ + /* the window border widgets from the rendered display. */ + window->w_flags &= ~(WIND_SCROLLABLE | WIND_SCROLLBARS | WIND_CAPTION + | WIND_BORDER); GrTCairoPlotSVG(cmd->tx_argv[2], window); + window->w_flags = flags; return; #endif