summaryrefslogtreecommitdiff
path: root/src/Fl_win32.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_win32.cxx')
-rw-r--r--src/Fl_win32.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 9abbb5d58..ec8cca9ae 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -2069,14 +2069,12 @@ Fl_X *Fl_WinAPI_Window_Driver::makeWindow() {
} else {
if (!size_range_set()) {
if (w->resizable()) {
- Fl_Widget *o = w->resizable();
- int minw = o->w();
- if (minw > 100)
- minw = 100;
- int minh = o->h();
- if (minh > 100)
- minh = 100;
- w->size_range(w->w() - o->w() + minw, w->h() - o->h() + minh, 0, 0);
+ Fl_Widget *o = w->resizable();
+ int minw = w->w(); // minw is window's initial width
+ int minh = w->h(); // minh is window's initial height
+ int maxw = (o->w() == 0) ? minw : 0; // if resizable w()==0, disable resize w()
+ int maxh = (o->h() == 0) ? minh : 0; // if resizable h()==0, disable resize h()
+ w->size_range(minw, minh, maxw, maxh);
} else {
w->size_range(w->w(), w->h(), w->w(), w->h());
}