workaround for occasional linux window misdraw
This commit is contained in:
@@ -56,15 +56,15 @@ func main() {
|
||||
} else {
|
||||
mainWindow.Controller.DoConnectToServerWorkflow(defaultServer)
|
||||
}
|
||||
// TODO: There is a race condition with laying out the window before the
|
||||
// window creation animation on Ubuntu (and other DEs?) finishes, where
|
||||
// the window will be misdrawn into a smaller area if the animation hasn't finished.
|
||||
// This makes it much less likely to occur (not seen on dozens of startups)
|
||||
// but is a hacky "solution"!
|
||||
|
||||
// hacky workaround for https://github.com/fyne-io/fyne/issues/4964
|
||||
if runtime.GOOS == "linux" {
|
||||
time.Sleep(350 * time.Millisecond)
|
||||
mainWindow.ForceResize()
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
w, h := mainWindow.DesiredSize()
|
||||
scale := mainWindow.Window.Canvas().Scale()
|
||||
SendResizeToPID(os.Getpid(), int(w*scale), int(h*scale))
|
||||
}
|
||||
|
||||
}()
|
||||
|
||||
mainWindow.Show()
|
||||
|
||||
Reference in New Issue
Block a user