From ec81b092d931bafc7feddea9e8a13877206f2fb3 Mon Sep 17 00:00:00 2001 From: gucio321 <73652197+gucio321@users.noreply.github.com> Date: Sun, 18 Feb 2024 20:17:39 +0100 Subject: [PATCH] mainthread: disable on windows in reference to https://github.com/AllenDang/giu/issues/735#issuecomment-1951419027 we have no mainthread library that works on windows. Due to this fact I think that the best solution is to disable mainthread completely for winows until we find some working solution. I'll create an issue about this as soon as this change is merged to master --- mainthread_all.go | 4 ++-- mainthread_windows.go | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 mainthread_windows.go diff --git a/mainthread_all.go b/mainthread_all.go index d6f2233d..f7cbdc3b 100644 --- a/mainthread_all.go +++ b/mainthread_all.go @@ -1,5 +1,5 @@ -//go:build !darwin -// +build !darwin +//go:build !darwin && !windows +// +build !darwin,!windows package giu diff --git a/mainthread_windows.go b/mainthread_windows.go new file mode 100755 index 00000000..e38db0d6 --- /dev/null +++ b/mainthread_windows.go @@ -0,0 +1,13 @@ +//go:build windows +// +build windows + +package giu + +// TODO: I have no working mainthread library for windows. +// - this one for macOS crashes app immediately +// - this for linux (and everything else) freezes after a few seconds +// +// With no mianthread support this at least runs sometimes. Just keep your giu calls in one thread and everything should work. +func mainthreadCallPlatform(c func()) { + c() +}