diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2025-04-26 15:04:26 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2025-04-26 15:04:49 +0200 |
commit | 4cf8c394b9b07d4bab2ea297edcfeb566af8e28f (patch) | |
tree | 502c0653aa4e01cc81a6aea1e70009d77c8e3e7a /xA/xA.go | |
parent | e225306419304360a85cbbe9b820de5914a9f7dc (diff) | |
download | xK-4cf8c394b9b07d4bab2ea297edcfeb566af8e28f.tar.gz xK-4cf8c394b9b07d4bab2ea297edcfeb566af8e28f.tar.xz xK-4cf8c394b9b07d4bab2ea297edcfeb566af8e28f.zip |
xA: bump Fyne to 2.6.0origin/master
Not much has actually changed.
Diffstat (limited to 'xA/xA.go')
-rw-r--r-- | xA/xA.go | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -1,4 +1,4 @@ -// Copyright (c) 2024, Přemysl Eric Janouch <p@janouch.name> +// Copyright (c) 2024 - 2025, Přemysl Eric Janouch <p@janouch.name> // 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 -------------------------------------------------------------- |