app: support changing Window options at runtime

A Window can now be requested to change its options after
it has been started via its Option method.

All options are supported on macOS, Windows and X11.
On Wayland, only the Size and Title options can be changed
at runtime.

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2021-04-06 18:46:29 +02:00
committed by Elias Naur
parent 96840772c7
commit abd6e8f9cd
5 changed files with 95 additions and 14 deletions
+11
View File
@@ -211,6 +211,17 @@ func (w *Window) Invalidate() {
}
}
// Option applies the options to the window.
func (w *Window) Option(opts ...Option) {
go w.driverDo(func() {
o := new(wm.Options)
for _, opt := range opts {
opt(o)
}
w.driver.Option(o)
})
}
// ReadClipboard initiates a read of the clipboard in the form
// of a clipboard.Event. Multiple reads may be coalesced
// to a single event.