devdraw: Shrinking a window on osx 10.6.7 no longer disables drawing.
R=rsc CC=plan9port.codebot http://codereview.appspot.com/4632051
This commit is contained in:
parent
ce8d6f2465
commit
e055ceb20b
1 changed files with 14 additions and 9 deletions
|
|
@ -524,8 +524,14 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
|
||||||
case kEventWindowClosed:
|
case kEventWindowClosed:
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
case kEventWindowBoundsChanged:
|
case kEventWindowBoundsChanged:;
|
||||||
eresized(0);
|
// We see kEventWindowDrawContent
|
||||||
|
// if we grow a window but not if we shrink it.
|
||||||
|
UInt32 flags;
|
||||||
|
GetEventParameter(event, kEventParamAttributes,
|
||||||
|
typeUInt32, 0, sizeof flags, 0, &flags);
|
||||||
|
int new = (flags & kWindowBoundsChangeSizeChanged) != 0;
|
||||||
|
eresized(new);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kEventWindowDrawContent:
|
case kEventWindowDrawContent:
|
||||||
|
|
@ -839,13 +845,12 @@ eresized(int new)
|
||||||
osx.screenimage = m;
|
osx.screenimage = m;
|
||||||
osx.screenr = r;
|
osx.screenr = r;
|
||||||
|
|
||||||
// I'm not 100% sure why this is necessary
|
if(new){
|
||||||
// but otherwise some resizes (esp. vertical ones)
|
|
||||||
// stop updating the screen.
|
|
||||||
qlock(&osx.flushlock);
|
qlock(&osx.flushlock);
|
||||||
QDEndCGContext(GetWindowPort(osx.window), &osx.windowctx);
|
QDEndCGContext(GetWindowPort(osx.window), &osx.windowctx);
|
||||||
osx.windowctx = nil;
|
osx.windowctx = nil;
|
||||||
qunlock(&osx.flushlock);
|
qunlock(&osx.flushlock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue