only use window size workaround on linux where needed
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -62,6 +63,7 @@ func main() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// slightly hacky workaround for https://github.com/fyne-io/fyne/issues/4964
|
// slightly hacky workaround for https://github.com/fyne-io/fyne/issues/4964
|
||||||
|
if runtime.GOOS == "linux" {
|
||||||
workaroundWindowSize := sync.OnceFunc(func() {
|
workaroundWindowSize := sync.OnceFunc(func() {
|
||||||
time.Sleep(50 * time.Millisecond)
|
time.Sleep(50 * time.Millisecond)
|
||||||
s := mainWindow.DesiredSize()
|
s := mainWindow.DesiredSize()
|
||||||
@@ -72,6 +74,7 @@ func main() {
|
|||||||
fyneApp.Lifecycle().SetOnEnteredForeground(func() {
|
fyneApp.Lifecycle().SetOnEnteredForeground(func() {
|
||||||
workaroundWindowSize()
|
workaroundWindowSize()
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
mainWindow.ShowAndRun()
|
mainWindow.ShowAndRun()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user