commit - 354c6c32f14f723022eacdfc965b0c9857e787f4
commit + 7e2a1983e7f39ce6fca05706959d0ea4a9f6961b
blob - bf2d0fdca62aae598fbdc9ac03831dfbafd82f47
blob + 3f2bcb8b9da3e3bb1cda8ea97f548dd3a4383246
--- src/cmd/devdraw/cocoa-screen.m
+++ src/cmd/devdraw/cocoa-screen.m
return YES; /* else no keyboard for old fullscreen */
}
@end
+
+double
+min(double a, double b)
+{
+ return a<b? a : b;
+}
enum
{
int i, set;
sr = [[NSScreen mainScreen] frame];
+ r = [[NSScreen mainScreen] visibleFrame];
if(s && *s){
if(parsewinsize(s, &wr, &set) < 0)
set = 0;
}
- /*
- * The origin is the left bottom corner for Cocoa.
- */
- r.origin.y = sr.size.height-wr.max.y;
- r = NSMakeRect(wr.min.x, r.origin.y, Dx(wr), Dy(wr));
+ r.origin.x = wr.min.x;
+ r.origin.y = sr.size.height-wr.max.y; /* winsize is top-left-based */
+ r.size.width = min(Dx(wr), r.size.width);
+ r.size.height = min(Dy(wr), r.size.height);
r = [NSWindow contentRectForFrameRect:r
styleMask:Winstyle];