diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-10-17 09:37:01 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-10-17 09:37:01 +0200 |
| commit | 50b04b565be5ddf21e2a14f6020655cafd5de0e6 (patch) | |
| tree | 5f7dd0c5424d442fed60a4f68370cb61c3abd885 | |
| parent | 38871c5b3192bccd508f3686413d4e56041ab091 (diff) | |
Fix Crashes and warnings when Fl_Double_Window is smaller than 1x1 (#798)
| -rw-r--r-- | src/Fl_x.cxx | 4 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 1dffa6e1c..27d4d8b01 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2144,6 +2144,10 @@ void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) { if (is_a_move && resize_from_program) force_position(1); else if (!is_a_resize && !is_a_move) return; if (is_a_resize) { + if (pWindow->as_double_window() && pWindow->parent()) { + if (W < 1) W = 1; + if (H < 1) H = 1; + } pWindow->Fl_Group::resize(X,Y,W,H); if (shown()) { #if FLTK_USE_CAIRO diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 5644f8ca8..07bb5230d 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -1820,6 +1820,10 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) { if (is_a_move) force_position(1); else if (!is_a_resize && !is_a_move) return; if (is_a_resize) { + if (pWindow->parent()) { + if (W < 1) W = 1; + if (H < 1) H = 1; + } pWindow->Fl_Group::resize(X,Y,W,H); //fprintf(stderr, "resize: win=%p to %dx%d\n", pWindow, W, H); if (shown()) {pWindow->redraw();} |
