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
+3 -9
View File
@@ -173,19 +173,13 @@ type context interface {
Unlock()
}
// basicDriver is the subset of [driver] that may be called even after
// a window is destroyed.
type basicDriver interface {
// driver is the interface for the platform implementation
// of a window.
type driver interface {
// Event blocks until an event is available and returns it.
Event() event.Event
// Invalidate requests a FrameEvent.
Invalidate()
}
// driver is the interface for the platform implementation
// of a window.
type driver interface {
basicDriver
// SetAnimating sets the animation flag. When the window is animating,
// FrameEvents are delivered as fast as the display can handle them.
SetAnimating(anim bool)