From 051521a89851975e5f42c6441eee4c757d67d46f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 22 Jul 2018 12:10:06 +0300 Subject: [PATCH] - set minimum size for Cocoa window --- src/posix/cocoa/i_video.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index d6e147cbb..edd1066de 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -494,9 +494,13 @@ void SystemGLFrameBuffer::SetWindowedMode() [m_window setHidesOnDeactivate:NO]; } + const int minimumFrameWidth = MINIMUM_WIDTH; + const int minimumFrameHeight = MINIMUM_HEIGHT + GetTitleBarHeight(); + const NSSize minimumFrameSize = NSMakeSize(minimumFrameWidth, minimumFrameHeight); + [m_window setMinSize:minimumFrameSize]; + const bool isFrameValid = win_x >= 0 && win_y >= 0 - && win_w >= MINIMUM_WIDTH - && win_h - GetTitleBarHeight() >= MINIMUM_HEIGHT; + && win_w >= minimumFrameWidth && win_h >= minimumFrameHeight; const NSRect frameSize = isFrameValid ? NSMakeRect(win_x, win_y, win_w, win_h) : NSMakeRect(0, 0, vid_defwidth, vid_defheight);