app: delete workarounds for driver callback deadlocks

Driver methods are invoked during event processing, but some of them may
generate events that would in turn deadlock because event processing is
not re-entrant. However, a previous change moved all such calls outside
event processing and so chained events can no longer deadlock.

This change deletes the workarounds.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-09-04 09:57:00 +02:00
parent 1796f24a38
commit 9ffe43bc3a
5 changed files with 11 additions and 19 deletions
+5 -5
View File
@@ -261,7 +261,7 @@ func (w *Window) Invalidate() {
// Option applies the options to the window.
func (w *Window) Option(opts ...Option) {
go w.driverDefer(func(d driver) {
w.driverDefer(func(d driver) {
c := new(config)
for _, opt := range opts {
opt(c)
@@ -274,21 +274,21 @@ func (w *Window) Option(opts ...Option) {
// of a clipboard.Event. Multiple reads may be coalesced
// to a single event.
func (w *Window) ReadClipboard() {
go w.driverDefer(func(d driver) {
w.driverDefer(func(d driver) {
d.ReadClipboard()
})
}
// WriteClipboard writes a string to the clipboard.
func (w *Window) WriteClipboard(s string) {
go w.driverDefer(func(d driver) {
w.driverDefer(func(d driver) {
d.WriteClipboard(s)
})
}
// SetCursorName changes the current window cursor to name.
func (w *Window) SetCursorName(name pointer.CursorName) {
go w.driverDefer(func(d driver) {
w.driverDefer(func(d driver) {
d.SetCursor(name)
})
}
@@ -299,7 +299,7 @@ func (w *Window) SetCursorName(name pointer.CursorName) {
// Currently, only macOS, Windows and X11 drivers implement this functionality,
// all others are stubbed.
func (w *Window) Close() {
go w.driverDefer(func(d driver) {
w.driverDefer(func(d driver) {
d.Close()
})
}