aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw
diff options
context:
space:
mode:
authorPocket7878 <poketo7878@gmail.com>2018-11-17 21:22:42 +0900
committerRuss Cox <rsc@swtch.com>2019-06-11 12:56:42 -0400
commitd4e16c838ab2cccd97ad6e24fc290239666eaaac (patch)
tree01103542ff635d9cce28563d6e7e166b22812739 /src/cmd/devdraw
parent7a241631b2097b1acda431ff059b771c5d1c391c (diff)
downloadplan9port-d4e16c838ab2cccd97ad6e24fc290239666eaaac.tar.gz
plan9port-d4e16c838ab2cccd97ad6e24fc290239666eaaac.tar.bz2
plan9port-d4e16c838ab2cccd97ad6e24fc290239666eaaac.zip
devdraw: handle windowDidResize on macOS (#212)
This supports non-live window resize.
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r--src/cmd/devdraw/cocoa-screen-metal.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/devdraw/cocoa-screen-metal.m b/src/cmd/devdraw/cocoa-screen-metal.m
index 09b34635..959df59b 100644
--- a/src/cmd/devdraw/cocoa-screen-metal.m
+++ b/src/cmd/devdraw/cocoa-screen-metal.m
@@ -342,6 +342,13 @@ struct Cursors {
return YES;
}
+- (void)windowDidResize:(NSNotification *)notification
+{
+ if(![myContent inLiveResize] && img) {
+ resizeimg();
+ }
+}
+
- (void)windowDidBecomeKey:(id)arg
{
[myContent sendmouse:0];
@@ -1112,7 +1119,6 @@ resizewindow(Rectangle r)
s = [myContent convertSizeFromBacking:NSMakeSize(Dx(r), Dy(r))];
[win setContentSize:s];
- resizeimg();
});
}