Closed iDevPro closed 2 months ago
Workaround :)
It is interesting that your workaround works on macOS as the code items = response.items
never gets executed on Linux. What should be used to update the UI from an asynchronous context is Idle which is based on GLib.idle_add. It seems to solve your problem with NSWindow
on macOS as well.
Idle {
items = response.items
}
It is interesting that your workaround works on macOS as the code
items = response.items
never gets executed on Linux. What should be used to update the UI from an asynchronous context is Idle which is based on GLib.idle_add. It seems to solve your problem withNSWindow
on macOS as well.Idle { items = response.items }
Yes, it is also work :)
From version 1.0.0 on (which is not yet released, it's being developed in https://github.com/AparokshaUI/adwaita-swift/pull/46), calling Idle
explicitly won't be required. If the update system detects an update not being executed on the main thread, it will automatically wrap with Idle
. You can still call it explicitly, but it might be more convenient to omit it for new code once you build on version 1.0.0.
Describe the bug
To Reproduce
Expected behavior
Update UI should be main thread :)
Additional context