From 849fcbd54696823d53286072b2619c711cb6c0f9 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Tue, 28 Mar 2023 19:29:27 -0700 Subject: [PATCH] use updated fyne base with fix for X11 modifiers; remove track selection workaround --- go.mod | 2 +- go.sum | 4 ++-- ui/widgets/tracklist.go | 17 ++--------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 3f7094c..6781a40 100644 --- a/go.mod +++ b/go.mod @@ -44,4 +44,4 @@ require ( honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect ) -replace fyne.io/fyne/v2 v2.3.3 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230326170603-cc96b423961f +replace fyne.io/fyne/v2 v2.3.3 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230329022206-560b167176a8 diff --git a/go.sum b/go.sum index 1953d90..635c832 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230326170603-cc96b423961f h1:GSY3SPE7ualBs+kaqjh2g5f6Djngq79oM6MycXQxElU= -github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230326170603-cc96b423961f/go.mod h1:MABZ23XXF2K24hl3rva+Di/UbMpibBMAO+qDtDCSe8k= +github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230329022206-560b167176a8 h1:h8runA6s7lsGYDKDU4oCSnFmd+LaP57AyRGY6aL9gMQ= +github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230329022206-560b167176a8/go.mod h1:MABZ23XXF2K24hl3rva+Di/UbMpibBMAO+qDtDCSe8k= github.com/dweymouth/go-subsonic v0.0.0-20230210044542-537b9238299b h1:8JbTKYDdQg6JKu7ZDbEaVbXxutc3pRF58yNvTVMBHec= github.com/dweymouth/go-subsonic v0.0.0-20230210044542-537b9238299b/go.mod h1:fUez6NFiEJiQTZizZ1BThZr5GJXAbigzGYjEPNm4tdI= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= diff --git a/ui/widgets/tracklist.go b/ui/widgets/tracklist.go index 7e7130d..024d055 100644 --- a/ui/widgets/tracklist.go +++ b/ui/widgets/tracklist.go @@ -2,7 +2,6 @@ package widgets import ( "log" - "runtime" "strconv" "supersonic/res" "supersonic/sharedutil" @@ -198,21 +197,9 @@ func (t *Tracklist) onPlayTrackAt(idx int) { } } -// Workaround for https://github.com/dweymouth/supersonic/issues/45 -// On Linux, tracklist selection will always operate in ctrl+click mode -// as this allows multi-select without getting 'stuck' in shift mode -func (t *Tracklist) modifiers() (fyne.KeyModifier, bool) { - if runtime.GOOS == "linux" { - return os.ControlModifier, true - } - if d, ok := fyne.CurrentApp().Driver().(desktop.Driver); ok { - return d.ActiveKeyModifiers(), true - } - return 0, false -} - func (t *Tracklist) onSelectTrack(idx int) { - if mod, ok := t.modifiers(); ok { + if d, ok := fyne.CurrentApp().Driver().(desktop.Driver); ok { + mod := d.CurrentKeyModifiers() if mod&os.ControlModifier != 0 { t.selectionMgr.SelectAddOrRemove(idx) } else if mod&fyne.KeyModifierShift != 0 {