From 445dcb829dd22f0e809538cdfe4a6c3535b2057f Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 26 Apr 2024 19:30:47 +0200 Subject: [PATCH] FLUID: Fix live resize for windows and tabs --- fluid/Fl_Group_Type.cxx | 11 +++++++---- fluid/Fl_Window_Type.cxx | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index 6c098252f..f42607b2d 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -720,10 +720,13 @@ void Fl_Tabs_Type::remove_child(Fl_Type* cc) { } Fl_Widget *Fl_Tabs_Type::enter_live_mode(int) { - Fl_Tabs *grp = new Fl_Tabs(o->x(), o->y(), o->w(), o->h()); - propagate_live_mode(grp); - grp->value(((Fl_Tabs*)o)->value()); - return grp; + Fl_Tabs *original = static_cast(o); + Fl_Tabs *clone = new Fl_Tabs(o->x(), o->y(), o->w(), o->h()); + propagate_live_mode(clone); + int tab_index = original->find(original->value()); + if ((tab_index>=0) && (tab_indexchildren())) + clone->value(clone->child(tab_index)); + return clone; } // ---- Fl_Scroll_Type ------------------------------------------------- MARK: - diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index b68af4406..2e77d386c 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1519,7 +1519,7 @@ void Fl_Widget_Class_Type::write_code2(Fd_Code_Writer& f) { // live mode support Fl_Widget *Fl_Window_Type::enter_live_mode(int) { - Fl_Window *win = new Fl_Window(o->x(), o->y(), o->w(), o->h()); + Fl_Window *win = new Fl_Window(10, 10, o->w(), o->h()); return propagate_live_mode(win); }