summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-03-25 12:15:44 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-03-25 12:16:03 +0100
commit24f9e7e7c48e8efba14c116cd1a123e27198236d (patch)
treea2bbb5f3947148ad09a336cb821de1032fa38889
parent456089d7f1b61b50eb0e6ed3ba336e5237e84318 (diff)
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.
-rw-r--r--src/Fl_win32.cxx7
1 files changed, 7 insertions, 0 deletions
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();