From 4cf8c394b9b07d4bab2ea297edcfeb566af8e28f Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sat, 26 Apr 2025 15:04:26 +0200 Subject: xA: bump Fyne to 2.6.0 Not much has actually changed. --- xA/xA.go | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'xA/xA.go') diff --git a/xA/xA.go b/xA/xA.go index f501622..707a280 100644 --- a/xA/xA.go +++ b/xA/xA.go @@ -1,4 +1,4 @@ -// Copyright (c) 2024, Přemysl Eric Janouch
+// Copyright (c) 2024 - 2025, Přemysl Eric Janouch
// SPDX-License-Identifier: 0BSD package main @@ -122,6 +122,10 @@ func (t *customTheme) Color( variant = theme.VariantDark } */ + /* + // Fyne 2.6.0 has a different bug, the Light variant is not applied: + variant = theme.VariantLight + */ // Fuck this low contrast shit, text must be black. if name == theme.ColorNameForeground && @@ -402,10 +406,7 @@ func refreshIcon() { break } } - - // Prevent deadlocks (though it might have a race condition). - // https://github.com/fyne-io/fyne/issues/5266 - go func() { wWindow.SetIcon(resource) }() + wWindow.SetIcon(resource) } func refreshTopic(topic []bufferLineItem) { @@ -1094,7 +1095,10 @@ func relayRun() { fyne.CurrentApp().Preferences().SetString(preferenceAddress, backendAddress) backendLock.Lock() - relayResetState() + fyne.DoAndWait(func() { + relayResetState() + }) + backendContext, backendCancel = context.WithCancel(context.Background()) defer backendCancel() var err error @@ -1102,8 +1106,10 @@ func relayRun() { backendLock.Unlock() if err != nil { - wConnect.Show() - showErrorMessage("Connection failed: " + err.Error()) + fyne.DoAndWait(func() { + wConnect.Show() + showErrorMessage("Connection failed: " + err.Error()) + }) return } defer backendConn.Close() @@ -1123,12 +1129,15 @@ Loop: if !ok { break Loop } - relayProcessMessage(&m) + fyne.DoAndWait(func() { + relayProcessMessage(&m) + }) } } - - wConnect.Show() - showErrorMessage("Disconnected") + fyne.DoAndWait(func() { + wConnect.Show() + showErrorMessage("Disconnected") + }) } // --- Input line -------------------------------------------------------------- -- cgit v1.2.3-70-g09d2