equal
deleted
inserted
replaced
449 int w, h; |
449 int w, h; |
450 int min_w, min_h; |
450 int min_w, min_h; |
451 int max_w, max_h; |
451 int max_w, max_h; |
452 int style; |
452 int style; |
453 BOOL menu; |
453 BOOL menu; |
|
454 BOOL constrain_max_size; |
454 |
455 |
455 /* If we allow resizing, let the resize happen naturally */ |
456 /* If we allow resizing, let the resize happen naturally */ |
456 if (SDL_IsShapedWindow(data->window)) |
457 if (SDL_IsShapedWindow(data->window)) |
457 Win32_ResizeWindowShape(data->window); |
458 Win32_ResizeWindowShape(data->window); |
458 |
459 |
471 min_w -= w; |
472 min_w -= w; |
472 min_h -= h; |
473 min_h -= h; |
473 if (max_w && max_h) { |
474 if (max_w && max_h) { |
474 max_w -= w; |
475 max_w -= w; |
475 max_h -= h; |
476 max_h -= h; |
|
477 constrain_max_size = TRUE; |
|
478 } else { |
|
479 constrain_max_size = FALSE; |
476 } |
480 } |
477 |
481 |
478 size.top = 0; |
482 size.top = 0; |
479 size.left = 0; |
483 size.left = 0; |
480 size.bottom = h; |
484 size.bottom = h; |
494 /* Fix our size to the current size */ |
498 /* Fix our size to the current size */ |
495 info = (MINMAXINFO *) lParam; |
499 info = (MINMAXINFO *) lParam; |
496 if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) { |
500 if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) { |
497 info->ptMinTrackSize.x = w + min_w; |
501 info->ptMinTrackSize.x = w + min_w; |
498 info->ptMinTrackSize.y = h + min_h; |
502 info->ptMinTrackSize.y = h + min_h; |
499 info->ptMaxTrackSize.x = w + max_w; |
503 if (constrain_max_size) { |
500 info->ptMaxTrackSize.y = h + max_h; |
504 info->ptMaxTrackSize.x = w + max_w; |
|
505 info->ptMaxTrackSize.y = h + max_h; |
|
506 } |
501 } else { |
507 } else { |
502 info->ptMaxSize.x = w; |
508 info->ptMaxSize.x = w; |
503 info->ptMaxSize.y = h; |
509 info->ptMaxSize.y = h; |
504 info->ptMaxPosition.x = x; |
510 info->ptMaxPosition.x = x; |
505 info->ptMaxPosition.y = y; |
511 info->ptMaxPosition.y = y; |