summaryrefslogtreecommitdiff
path: root/fluid/Fl_Window_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-07-17 12:56:23 +0200
committerMatthias Melcher <github@matthiasm.com>2023-07-17 12:56:35 +0200
commit4d94a08bd2fcd681d33bfb51228ace3b432b19ab (patch)
tree5867ce7627bf48eaf8cd7fe8ce76839ea37ab36b /fluid/Fl_Window_Type.cxx
parent4dffa31520f66fe0baea574ea391ec58a77eaa49 (diff)
FLUID: fix window visibility across project file update
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
-rw-r--r--fluid/Fl_Window_Type.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx
index cb7292947..37fd10b93 100644
--- a/fluid/Fl_Window_Type.cxx
+++ b/fluid/Fl_Window_Type.cxx
@@ -1193,7 +1193,7 @@ void Fl_Window_Type::write_properties(Fd_Project_Writer &f) {
if (xclass) {f.write_string("xclass"); f.write_word(xclass);}
if (sr_min_w || sr_min_h || sr_max_w || sr_max_h)
f.write_string("size_range {%d %d %d %d}", sr_min_w, sr_min_h, sr_max_w, sr_max_h);
- if (o->visible()) f.write_string("visible");
+ if (o->visible() || override_visible_) f.write_string("visible");
}
void Fl_Window_Type::read_property(Fd_Project_Reader &f, const char *c) {
@@ -1202,7 +1202,10 @@ void Fl_Window_Type::read_property(Fd_Project_Reader &f, const char *c) {
} else if (!strcmp(c,"non_modal")) {
non_modal = 1;
} else if (!strcmp(c, "visible")) {
- if (Fl::first_window()) open_(); // only if we are using user interface
+ if (batch_mode) // don't actually open any windows in batch mode
+ override_visible_ = 1;
+ else // in interactive mode, we simply show the window
+ open_();
} else if (!strcmp(c,"noborder")) {
((Fl_Window*)o)->border(0);
} else if (!strcmp(c,"xclass")) {