mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
Revert "app: [macOS] ensure the Window is initalized before Run functions"
This reverts commit 5083a23301 because Option
and Run no longer create the window.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-7
@@ -326,7 +326,6 @@ type window struct {
|
||||
cursor pointer.Cursor
|
||||
pointerBtns pointer.Buttons
|
||||
loop *eventLoop
|
||||
initialized bool
|
||||
|
||||
scale float32
|
||||
config Config
|
||||
@@ -834,9 +833,7 @@ func (w *window) draw() {
|
||||
|
||||
func (w *window) ProcessEvent(e event.Event) {
|
||||
w.w.ProcessEvent(e)
|
||||
if w.initialized {
|
||||
w.loop.FlushEvents()
|
||||
}
|
||||
w.loop.FlushEvents()
|
||||
}
|
||||
|
||||
func (w *window) Event() event.Event {
|
||||
@@ -927,6 +924,7 @@ func newWindow(win *callbacks, options []Option) {
|
||||
}
|
||||
w.loop = newEventLoop(w.w, w.wakeup)
|
||||
win.SetDriver(w)
|
||||
res <- struct{}{}
|
||||
if err := w.init(); err != nil {
|
||||
w.ProcessEvent(DestroyEvent{Err: err})
|
||||
return
|
||||
@@ -944,9 +942,6 @@ func newWindow(win *callbacks, options []Option) {
|
||||
nextTopLeft = C.cascadeTopLeftFromPoint(window, nextTopLeft)
|
||||
// makeKeyAndOrderFront assumes ownership of our window reference.
|
||||
C.makeKeyAndOrderFront(window)
|
||||
w.initialized = true
|
||||
res <- struct{}{}
|
||||
w.loop.FlushEvents()
|
||||
})
|
||||
<-res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user