From 2b1bed470f2f2e40da6a5a2b87c60aca75d5cf0b Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 16 Feb 2019 00:00:24 +0100 Subject: Fix Fluid batch mode with Fl_Simple_Terminal. Fl_Simple_Terminal would connect Fluid to the Display in batch mode. We fix that by creating an Fl_Text_Display instead. --- fluid/factory.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fluid/factory.cxx b/fluid/factory.cxx index c71fc97ae..cd7c53c9e 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -614,7 +614,15 @@ public: virtual const char *alt_type_name() {return "fltk::SimpleTerminal";} int is_text_display() const {return 1;} Fl_Widget *widget(int x,int y,int w,int h) { - Fl_Simple_Terminal *myo = new Fl_Simple_Terminal(x,y,w,h); + Fl_Widget *myo = 0L; + if (batch_mode) { + // The Fl_Simple_Terminal constructor attaches a buffer which in turn + // opens a connection to the display. In batch mode, we create the + // superclass Fl_Text_Display to avoid that. + myo = new Fl_Text_Display(x,y,w,h); + } else { + myo = new Fl_Simple_Terminal(x,y,w,h); + } return myo; } Fl_Widget_Type *_make() {return new Fl_Simple_Terminal_Type();} -- cgit v1.2.3