mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
app/internal/window: [macOS] make GioDelegate window-independent
Updates #19 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -38,6 +38,7 @@ __attribute__ ((visibility ("hidden"))) CGFloat gio_getViewBackingScale(CFTypeRe
|
||||
__attribute__ ((visibility ("hidden"))) CFTypeRef gio_readClipboard(void);
|
||||
__attribute__ ((visibility ("hidden"))) void gio_writeClipboard(unichar *chars, NSUInteger length);
|
||||
__attribute__ ((visibility ("hidden"))) void gio_setNeedsDisplay(CFTypeRef viewRef);
|
||||
__attribute__ ((visibility ("hidden"))) void gio_makeKeyAndOrderFront(CFTypeRef viewRef);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -278,6 +279,13 @@ func gio_onCreate(view C.CFTypeRef) {
|
||||
w.w = wopts.window
|
||||
w.w.SetDriver(w)
|
||||
insertView(view, w)
|
||||
if len(viewMap) == 1 {
|
||||
C.CFRetain(view)
|
||||
runOnMain(func() {
|
||||
defer C.CFRelease(view)
|
||||
C.gio_makeKeyAndOrderFront(view)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func NewWindow(win Callbacks, opts *Options) error {
|
||||
|
||||
Reference in New Issue
Block a user