summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2019-02-16 00:00:24 +0100
committerMatthias Melcher <git@matthiasm.com>2019-02-16 00:00:24 +0100
commit2b1bed470f2f2e40da6a5a2b87c60aca75d5cf0b (patch)
tree0091bb87735624fba53bb6121cdd94bf25e8fae6 /fluid
parentc92f992380704942825e6dcf4363ea45585ac6cd (diff)
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.
Diffstat (limited to 'fluid')
-rw-r--r--fluid/factory.cxx10
1 files changed, 9 insertions, 1 deletions
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();}