mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app: replace Window.Config with ConfigEvent
Unlike Raise, Close and other fire-and-forget methods on Window, Config calls driverRun because it needs to wait for the result. However, driverRun isn't guaranteed to block in all contexts. This change avoids the synchronization dance altogether by removing the Config method and introducing a ConfigEvent event. The event also makes it clear when the configuration changes. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -263,17 +263,6 @@ func (w *Window) Option(opts ...Option) {
|
||||
})
|
||||
}
|
||||
|
||||
// Config returns the Window configuration.
|
||||
//
|
||||
// A FrameEvent will occur whenever the configuration changes.
|
||||
func (w *Window) Config() Config {
|
||||
var cnf Config
|
||||
w.driverRun(func(d driver) {
|
||||
cnf = d.Config()
|
||||
})
|
||||
return cnf
|
||||
}
|
||||
|
||||
// ReadClipboard initiates a read of the clipboard in the form
|
||||
// of a clipboard.Event. Multiple reads may be coalesced
|
||||
// to a single event.
|
||||
|
||||
Reference in New Issue
Block a user