From a17e294bf905d5ca9d0e81164cffe4554ccc3122 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 4 May 2021 19:16:08 +0100 Subject: [PATCH 1/3] Fix warnings in glfw driver --- internal/driver/glfw/animation.go | 8 ++++---- internal/driver/glfw/window.go | 14 -------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/internal/driver/glfw/animation.go b/internal/driver/glfw/animation.go index d6dfde69f9..ec7d72a180 100644 --- a/internal/driver/glfw/animation.go +++ b/internal/driver/glfw/animation.go @@ -2,10 +2,10 @@ package glfw import "fyne.io/fyne/v2" -func (g *gLDriver) StartAnimation(a *fyne.Animation) { - g.animation.Start(a) +func (d *gLDriver) StartAnimation(a *fyne.Animation) { + d.animation.Start(a) } -func (g *gLDriver) StopAnimation(a *fyne.Animation) { - g.animation.Stop(a) +func (d *gLDriver) StopAnimation(a *fyne.Animation) { + d.animation.Stop(a) } diff --git a/internal/driver/glfw/window.go b/internal/driver/glfw/window.go index a4bc050794..3f06637dab 100644 --- a/internal/driver/glfw/window.go +++ b/internal/driver/glfw/window.go @@ -1226,20 +1226,6 @@ func (w *window) focused(_ *glfw.Window, isFocused bool) { } } -func isKeyModifierPair(keyName fyne.KeyName, modifier desktop.Modifier) bool { - switch modifier { - case desktop.ShiftModifier: - return (keyName == desktop.KeyShiftLeft || keyName == desktop.KeyShiftRight) - case desktop.ControlModifier: - return (keyName == desktop.KeyControlLeft || keyName == desktop.KeyControlRight) - case desktop.AltModifier: - return (keyName == desktop.KeyAltLeft || keyName == desktop.KeyAltRight) - case desktop.SuperModifier: - return (keyName == desktop.KeySuperLeft || keyName == desktop.KeySuperRight) - } - return false -} - func (w *window) triggersShortcut(keyName fyne.KeyName, modifier desktop.Modifier) bool { var shortcut fyne.Shortcut ctrlMod := desktop.ControlModifier From 28508ce78e77dc825c4c0fbf716f6c216b0f7d29 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 4 May 2021 19:34:33 +0100 Subject: [PATCH 2/3] Fix annoying reordering of imports --- cmd/fyne/internal/commands/package.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/fyne/internal/commands/package.go b/cmd/fyne/internal/commands/package.go index e5d5686491..c1485eaa11 100644 --- a/cmd/fyne/internal/commands/package.go +++ b/cmd/fyne/internal/commands/package.go @@ -3,20 +3,19 @@ package commands import ( "flag" "fmt" - "log" - "runtime" - "strconv" - "strings" - // import image encodings _ "image/jpeg" _ "image/png" + "log" "os" "path/filepath" + "strconv" + "strings" - "fyne.io/fyne/v2/cmd/fyne/internal/util" "github.com/pkg/errors" "github.com/urfave/cli/v2" + + "fyne.io/fyne/v2/cmd/fyne/internal/util" ) const ( From 1c34798c71e74488b90377875e8f5e444744bd53 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 4 May 2021 19:34:54 +0100 Subject: [PATCH 3/3] Fix accidental removal of windows builds during cross-compile --- cmd/fyne/internal/commands/package.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/fyne/internal/commands/package.go b/cmd/fyne/internal/commands/package.go index c1485eaa11..29f6d31242 100644 --- a/cmd/fyne/internal/commands/package.go +++ b/cmd/fyne/internal/commands/package.go @@ -194,7 +194,7 @@ func (p *Packager) doPackage() error { if !util.Exists(p.exe) { return fmt.Errorf("unable to build directory to expected executable, %s", p.exe) } - if runtime.GOOS != "windows" { + if p.os != "windows" { defer p.removeBuild() } }