diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 729769d86..8fe4c9edf 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1808,6 +1808,7 @@ void Fl_Widget_Type::open() { Fl_Type *Fl_Type::current; extern void redraw_overlays(); +extern void check_redraw_corresponding_parent(Fl_Type*); extern void redraw_browser(); extern void update_sourceview_position(); @@ -1839,6 +1840,7 @@ void selection_changed(Fl_Type *p) { } if (!p || !p->selected) p = q; Fl_Type::current = p; + check_redraw_corresponding_parent(p); redraw_overlays(); // load the panel with the new settings: load_panel(); diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index c4613a9bf..3b766f081 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1065,6 +1065,22 @@ void Fl_Window_Type::fix_overlay() { ((Overlay_Window *)(this->o))->redraw_overlay(); } +// check if we must redraw any parent of tabs/wizard type +void check_redraw_corresponding_parent(Fl_Type *s) { + Fl_Widget_Type * prev_parent = 0; + if( !s || !s->selected || !s->is_widget()) return; + for (Fl_Type *i=s; i && i->parent; i=i->parent) { + if (i->is_group() && prev_parent && + (!strcmp(i->type_name(), "Fl_Tabs") || + !strcmp(i->type_name(), "Fl_Wizard"))) { + ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o); + return; + } + if (i->is_group() && s->is_widget()) + prev_parent = (Fl_Widget_Type*)i; + } +} + // do that for every window (when selected set changes): void redraw_overlays() { for (Fl_Type *o=Fl_Type::first; o; o=o->next)