fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.1k stars 1.4k forks source link

Additional Window not loading properly #3653

Open JayZeeeS opened 1 year ago

JayZeeeS commented 1 year ago

Checklist

Describe the bug

When opening more than one window with the Window.Show() method after resizing with Window.Resize(), the content in said window is not visible, while the main window is still fine. See the Canvas and text windows in the screenshots. When resized manually

How to reproduce

Run the provided code with go run app.go

Screenshots

image image image

Example code

package main

import (
    "fyne.io/fyne/v2"
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/widget"
)

func main() {
    a := app.New()
    w := a.NewWindow("window1")
    w.SetContent(widget.NewLabel("Hello"))

    w2 := a.NewWindow("window2")
    w2.SetContent(widget.NewLabel("World"))

    w.Resize(fyne.NewSize(300, 300))
    w2.Resize(fyne.NewSize(300, 300))
    w.Show()
    w2.Show()
    a.Run()
}

Fyne version

2.3.0

Go compiler version

1.20

Operating system

WSL2 Linux on Windows 11

Operating system version

WSL2 Ubuntu-20.04

Additional Information

When compiled to Windows, it behaves properly. Linux desktop environment: WSL

Jacalz commented 1 year ago

I don’t think we officially support WSL. It behaves very strangely in some cases. To be honest, I don’t know if this is a bug in Fyne or in the emulation that WSL is doing.

Bluebugs commented 1 year ago

It is my understanding that WSL is actually a RDP over a Wayland session.

andydotxyz commented 1 year ago

I'm not sure what to do here. Is anyone able to work on WSL2? I don't think it's on the officially supported list. Should it be?

Bluebugs commented 1 year ago

I got application to display last time I tried, but they had the short coming of Wayland application as that's what's running under the hood.

Jacalz commented 1 year ago

It is my understanding that WSL is actually a RDP over a Wayland session.

I'm not entirely sure to which degree that it is the case. I know they have been working on translating OpenGL and Vulkan into DirectX12 among other things. They should probably also have some XWayland implementation as well.

It seems hard to target WSL in development and do specific fixes for it as it is running Linux binaries and then doing some kind of translation. We will always be at the mercy of the Linux version together with any possible issues in the translation.

I don't think it's on the officially supported list. Should it be?

I know that quite a few people would like it to work but I don't see how we can change things on our end to make it work any better. If it works, it works.

Bluebugs commented 1 year ago

The translation to windows driver is orthogonal to the protocol used to manage windows. It is opengl and as long as we follow opengl, that should just work. I have not seen any rendering issue when I tried.

There was not any X server exposed when I tried, but just Wayland last time. They may have added it since then. Would be worth checking today. In any case of it is XWayland or Wayland, it behave the same as on Linux. It is literally running Wayland with a rdp backend in a vm that run Linux.

Jacalz commented 1 year ago

There might also be differences between WSL and WSL2. I don't know if both still are available. They might be.

Jacalz commented 1 year ago

You're right. There might not be X11 support by default from what I can tell. Perhaps it just is bugs in our Wayland code that are surfacing (it is far from complete at the moment)?

EDIT: Or maybe not? The user above does not seem to run with Wayland support enabled from looking at the command used.

andydotxyz commented 1 year ago

I'm surprised that this just works then - as our wayland code is off by default...

andydotxyz commented 1 year ago

It may relate to the Rosetta discussion as these are both emulations on an OS that we support natively - so should we continue to put work into supporting the emulation? https://github.com/fyne-io/fyne/issues/3971