forked from joejulian/gio
app: add cross-platform empty view event detection
Custom rendering applications need to be prepared to handle empty view events, as an empty view event is sent during window shutdown. However, the current implementation requires applications to write a platform-specific helper function for each supported platform in order to check whether a received view event is empty. This commit provides a safe, convenient, cross-platform method that applications can use to detect this special view event and respond to it. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -61,6 +61,10 @@ type FrameEvent struct {
|
||||
type ViewEvent interface {
|
||||
implementsViewEvent()
|
||||
ImplementsEvent()
|
||||
// Valid will return true when the ViewEvent does contains valid handles.
|
||||
// If a window receives an invalid ViewEvent, it should deinitialize any
|
||||
// state referring to handles from a previous ViewEvent.
|
||||
Valid() bool
|
||||
}
|
||||
|
||||
// Insets is the space taken up by
|
||||
|
||||
Reference in New Issue
Block a user