From 24f9e7e7c48e8efba14c116cd1a123e27198236d Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 25 Mar 2020 12:15:44 +0100 Subject: Fix for issue #65: FLTK breaks when resize request is denied Under Windows, window resize requests sent by the program are now ignored, which is what happens under X11 and macOS. Previously, the window would become frozen. --- src/Fl_win32.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 9c23bae40..090e49580 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1846,6 +1846,13 @@ void Fl_WinAPI_Window_Driver::resize(int X, int Y, int W, int H) { flags |= SWP_NOMOVE; } if (is_a_resize) { + if (resize_from_program && shown()) { + // don't obey "resize from program" when window is maximized + WINDOWPLACEMENT wplace; + wplace.length = sizeof(WINDOWPLACEMENT); + BOOL ok = GetWindowPlacement(fl_xid(pWindow), &wplace); + if (ok && wplace.showCmd == SW_SHOWMAXIMIZED) return; + } pWindow->Fl_Group::resize(X, Y, W, H); if (visible_r()) { pWindow->redraw(); -- cgit v1.2.3