aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Swasey <david.swasey@gmail.com>2011-06-20 14:11:21 -0400
committerRuss Cox <rsc@swtch.com>2011-06-20 14:11:21 -0400
commite055ceb20bd94caff3b07e64a051ab3a899c0463 (patch)
tree2b6bbc248ba98fa4f04a40cc8e11906e131082db /src
parentce8d6f246568cdb397a0a0095ad843a9769149a8 (diff)
downloadplan9port-e055ceb20bd94caff3b07e64a051ab3a899c0463.tar.gz
plan9port-e055ceb20bd94caff3b07e64a051ab3a899c0463.tar.bz2
plan9port-e055ceb20bd94caff3b07e64a051ab3a899c0463.zip
devdraw: Shrinking a window on osx 10.6.7 no longer disables drawing.
R=rsc CC=plan9port.codebot http://codereview.appspot.com/4632051
Diffstat (limited to 'src')
-rw-r--r--src/cmd/devdraw/osx-screen-carbon.m23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/cmd/devdraw/osx-screen-carbon.m b/src/cmd/devdraw/osx-screen-carbon.m
index 01356726..2f295a03 100644
--- a/src/cmd/devdraw/osx-screen-carbon.m
+++ b/src/cmd/devdraw/osx-screen-carbon.m
@@ -524,8 +524,14 @@ eventhandler(EventHandlerCallRef next, EventRef event, void *arg)
case kEventWindowClosed:
exit(0);
- case kEventWindowBoundsChanged:
- eresized(0);
+ case kEventWindowBoundsChanged:;
+ // 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;
case kEventWindowDrawContent:
@@ -839,13 +845,12 @@ eresized(int new)
osx.screenimage = m;
osx.screenr = r;
- // I'm not 100% sure why this is necessary
- // but otherwise some resizes (esp. vertical ones)
- // stop updating the screen.
- qlock(&osx.flushlock);
- QDEndCGContext(GetWindowPort(osx.window), &osx.windowctx);
- osx.windowctx = nil;
- qunlock(&osx.flushlock);
+ if(new){
+ qlock(&osx.flushlock);
+ QDEndCGContext(GetWindowPort(osx.window), &osx.windowctx);
+ osx.windowctx = nil;
+ qunlock(&osx.flushlock);
+ }
}
void