app: ignore Invalidate for Windows not yet created

While here, don't overflow the Windows event queue.

Fixes: https://todo.sr.ht/~eliasnaur/gio/596
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2024-06-27 12:37:44 +02:00
parent 42357a29e0
commit 3f671afea8
6 changed files with 40 additions and 83 deletions
+1 -11
View File
@@ -217,10 +217,6 @@ type window struct {
wakeups chan struct{}
closing bool
// invMu avoids the race between the destruction of disp and
// Invalidate waking it up.
invMu sync.Mutex
}
type poller struct {
@@ -1369,10 +1365,8 @@ func (w *window) close(err error) {
w.ProcessEvent(WaylandViewEvent{})
w.ProcessEvent(DestroyEvent{Err: err})
w.destroy()
w.invMu.Lock()
w.disp.destroy()
w.disp = nil
w.invMu.Unlock()
}
func (w *window) dispatch() {
@@ -1416,11 +1410,7 @@ func (w *window) Invalidate() {
default:
return
}
w.invMu.Lock()
defer w.invMu.Unlock()
if w.disp != nil {
w.disp.wakeup()
}
w.disp.wakeup()
}
func (w *window) Run(f func()) {