uis/app: (macos) relay system focus events

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-20 18:45:46 +02:00
parent a9199c6d23
commit b9205d9965
2 changed files with 16 additions and 4 deletions
+6
View File
@@ -130,6 +130,12 @@ func gio_onDraw(view C.CFTypeRef) {
w.draw(true)
}
//export gio_onFocus
func gio_onFocus(view C.CFTypeRef, focus C.BOOL) {
w := views[view]
w.w.event(key.Focus{Focus: focus == C.YES})
}
func (w *window) draw(sync bool) {
width, height := int(C.gio_viewWidth(w.view)+.5), int(C.gio_viewHeight(w.view)+.5)
if width == 0 || height == 0 {