ui/app: (macOS) redraw when NSOpenGLView update is called

When moving a window to another monitor, update is called when the
opengl backing store updates its internal size.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-21 17:20:44 +02:00
parent 8eea6b80f3
commit 71f6df9352
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -67,6 +67,10 @@ CVDisplayLinkRef displayLink;
- (BOOL)isFlipped {
return YES;
}
- (void)update {
[super update];
gio_onDraw((__bridge CFTypeRef)self);
}
- (void)drawRect:(NSRect)r {
gio_onDraw((__bridge CFTypeRef)self);
}
+3 -2
View File
@@ -170,8 +170,9 @@ func gio_onMouse(view C.CFTypeRef, cdir C.int, x, y, dx, dy C.CGFloat, ti C.doub
//export gio_onDraw
func gio_onDraw(view C.CFTypeRef) {
viewDo(view, func(views viewMap, view C.CFTypeRef) {
w := views[view]
w.draw(true)
if w, exists := views[view]; exists {
w.draw(true)
}
})
}