mirror of
https://github.com/transmission/transmission
synced 2025-03-12 15:14:12 +00:00
make sure there's a screen before attempting to constrain info window size
This commit is contained in:
parent
25a5834614
commit
01590dacf3
1 changed files with 10 additions and 7 deletions
|
@ -301,6 +301,8 @@ typedef enum
|
||||||
windowRect.size.height += difference;
|
windowRect.size.height += difference;
|
||||||
|
|
||||||
if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method
|
if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method
|
||||||
|
{
|
||||||
|
if ([window screen])
|
||||||
{
|
{
|
||||||
const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
|
const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
|
||||||
if (NSHeight(windowRect) > screenHeight)
|
if (NSHeight(windowRect) > screenHeight)
|
||||||
|
@ -311,6 +313,7 @@ typedef enum
|
||||||
|
|
||||||
viewRect.size.height += difference;
|
viewRect.size.height += difference;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)];
|
[window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)];
|
||||||
[window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
|
[window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
|
||||||
|
|
Loading…
Add table
Reference in a new issue