mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
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:
@@ -67,6 +67,10 @@ CVDisplayLinkRef displayLink;
|
|||||||
- (BOOL)isFlipped {
|
- (BOOL)isFlipped {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
- (void)update {
|
||||||
|
[super update];
|
||||||
|
gio_onDraw((__bridge CFTypeRef)self);
|
||||||
|
}
|
||||||
- (void)drawRect:(NSRect)r {
|
- (void)drawRect:(NSRect)r {
|
||||||
gio_onDraw((__bridge CFTypeRef)self);
|
gio_onDraw((__bridge CFTypeRef)self);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -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
|
//export gio_onDraw
|
||||||
func gio_onDraw(view C.CFTypeRef) {
|
func gio_onDraw(view C.CFTypeRef) {
|
||||||
viewDo(view, func(views viewMap, view C.CFTypeRef) {
|
viewDo(view, func(views viewMap, view C.CFTypeRef) {
|
||||||
w := views[view]
|
if w, exists := views[view]; exists {
|
||||||
w.draw(true)
|
w.draw(true)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user