mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
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:
@@ -113,9 +113,6 @@ type x11Window struct {
|
||||
wakeups chan struct{}
|
||||
handler x11EventHandler
|
||||
buf [100]byte
|
||||
|
||||
// invMy avoids the race between destroy and Invalidate.
|
||||
invMu sync.Mutex
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -416,11 +413,6 @@ func (w *x11Window) Invalidate() {
|
||||
case w.wakeups <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
w.invMu.Lock()
|
||||
defer w.invMu.Unlock()
|
||||
if w.x == nil {
|
||||
return
|
||||
}
|
||||
if _, err := syscall.Write(w.notify.write, x11OneByte); err != nil && err != syscall.EAGAIN {
|
||||
panic(fmt.Errorf("failed to write to pipe: %v", err))
|
||||
}
|
||||
@@ -509,8 +501,6 @@ func (w *x11Window) dispatch() {
|
||||
}
|
||||
|
||||
func (w *x11Window) destroy() {
|
||||
w.invMu.Lock()
|
||||
defer w.invMu.Unlock()
|
||||
if w.notify.write != 0 {
|
||||
syscall.Close(w.notify.write)
|
||||
w.notify.write = 0
|
||||
|
||||
Reference in New Issue
Block a user