mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
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:
+2
-8
@@ -198,7 +198,7 @@ func (w *window) contextView() C.CFTypeRef {
|
||||
|
||||
func (w *window) ReadClipboard() {
|
||||
content := nsstringToString(C.readClipboard())
|
||||
go w.w.Event(clipboard.Event{Text: content})
|
||||
w.w.Event(clipboard.Event{Text: content})
|
||||
}
|
||||
|
||||
func (w *window) WriteClipboard(s string) {
|
||||
@@ -283,13 +283,7 @@ func (w *window) runOnMain(f func()) {
|
||||
}
|
||||
|
||||
func (w *window) Close() {
|
||||
// close immediately calls gio_onClose which sends events
|
||||
// causing a deadlock because Close is called during an event.
|
||||
// Break the deadlock by deferring the close, making Close more
|
||||
// akin to a message like the other platforms.
|
||||
go w.runOnMain(func() {
|
||||
C.closeWindow(w.window)
|
||||
})
|
||||
C.closeWindow(w.window)
|
||||
}
|
||||
|
||||
func (w *window) setStage(stage system.Stage) {
|
||||
|
||||
Reference in New Issue
Block a user