fyne-io / fyne

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

Initial window display is blank on Gnome (until hover or resize) #645

Closed rootVIII closed 4 years ago

rootVIII commented 4 years ago

My apologies in advance if this is already mentioned in another issue. And thank you for all the hard work... The whole project is really awesome (and helpful).

Describe the bug:

All applications (mine and demo apps) open with a blank screen until a "mouse-hover" occurs over the application's window.

It looks like the content is possibly crammed into the top left corner of the open application's blank window (see screenshot).

The GUI content appears and works as normal after a mouse-hover or click within the running application's window.

To Reproduce:

Steps to reproduce the behaviour:

  1. Only tested with go run <appname.go>

Screenshots:

https://drive.google.com/open?id=1x3ogKkl6mskgj1YFIwV6uMp9Y3FDvQ3y

Here's a before and after "mouse-hover" with the demo app: https://drive.google.com/open?id=1QkzDLgWPwb6Mf_ofw2fEc5VBR1EGrGgE https://drive.google.com/open?id=1Y6Byub5Irz0nec5kwc77a_Gg2G3XuCbm

Example code:

Issue happens with all examples, including demo code.

Device (please complete the following information):

andydotxyz commented 4 years ago

It's possible that this relates to your window manager as this works correctly for most Linux users. Can you expand on your desktop or WM configuration please?

rootVIII commented 4 years ago

Hi! Sure... I run Ubuntu on a Dell Desktop (No Virtual Machine). According to /etc/systemd/system/display-manager.service my window manager is /usr/sbin/gdm3. Here's some other details although not sure if it's helpful:

james@rootVIII:~$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  8
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               158
Model name:          Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Stepping:            12
CPU MHz:             1198.715
CPU max MHz:         4900.0000
CPU min MHz:         800.0000
BogoMIPS:            7200.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            12288K

Not sure if this is needed either but here it is:

james@rootVIII:~$ sudo lshw -c video
  *-display                 
       description: VGA compatible controller
       product: GP104 [GeForce GTX 1070]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nouveau latency=0
       resources: irq:142 memory:eb000000-ebffffff memory:a0000000-afffffff memory:b0000000-b1ffffff ioport:e000(size=128) memory:c0000-dffff
  *-display
       description: Display controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm bus_master cap_list
       configuration: driver=i915 latency=0
       resources: iomemory:2f0-2ef irq:141 memory:2ffe000000-2ffeffffff memory:90000000-9fffffff ioport:f000(size=64)
andydotxyz commented 4 years ago

Thanks for that. However display manager is the part of the system that logs you in but not the part that manages your windows - are you given a choice of desktops when you log in or is it all vanilla Ubuntu? (which I guess would make it Unity?).

The installed window managers will be listed in /usr/share/xsessions/ - if there is only one file then it's an easy answer ;)

andydotxyz commented 4 years ago

Oh also - is this the same on both displays?

rootVIII commented 4 years ago

Ah yup... just plain Ubuntu (ie gnome). I think they stopped with Unity after 16? But no there's no option to choose Desktops without customizing I think. But anyways here's the output:

james@rootVIII:~$ cat /usr/share/xsessions/ubuntu.desktop 
[Desktop Entry]
Name=Ubuntu
Comment=This session logs you into Ubuntu
Exec=env GNOME_SHELL_SESSION_MODE=ubuntu gnome-session --session=ubuntu
TryExec=gnome-shell
Type=Application
DesktopNames=ubuntu:GNOME
X-Ubuntu-Gettext-Domain=gnome-session-3.0

EDIT: I may actually try a different desktop environment when I have a bit more time... possibly tonight or tomorrow. I always thought gnome was a little clunky feeling. I may try KDE Plasma Desktop

andydotxyz commented 4 years ago

Hmm, it is working for others in Gnome, this is very strange! Just for more information does it also fix if you resize the window (whilst keeping the mouse out of it ;))

rootVIII commented 4 years ago

Actually yes... it seems to make it appear when resizing! It's hard to tell if it's from the click or the hover? I think the resize does actually make it appear though.

rootVIII commented 4 years ago

So as of last night I have officially switched to Kubuntu! The problem does not occur and the GUI loads right away.

a2800276 commented 4 years ago

This also affects Ubuntu 19 ... Does anyone have any idea what the problem is or what a workaround could be? Ubuntu is a fairly prominent distro, it would be a shame not to support it.

rootVIII commented 4 years ago

Definitely the desktop environment.... I agree though... hope they work this bug out for regular old Ubuntu.

andydotxyz commented 4 years ago

I have just installed a vanilla Ubuntu environment, followed the instructions on https://fyne.io/develop/index to get fyne up and running and the apps work exactly as expected.

Are there any configuration items you have applied, or user choices that might impact the window manager or desktop environment @rootVIII @a2800276 ?

andydotxyz commented 4 years ago

Also can I check you are both using the latest (v1.2.4) Fyne release? (go get -u fyne.io/fyne/cmd/fyne_demo will install the latest demo app)

a2800276 commented 4 years ago

@andydotxyz sorry for not responding earlier, I've overlooked the notification. I'll try to have a look today or tomorrow.

I'm using 19.04 and don't think I have any relevant modifications, definitely nothing major like a non-out-of-box windowmanager.

Thanks!

andydotxyz commented 4 years ago

It turns out there were some race conditions in this area that we are working though. In a few days there should be a whole new render pipeline that may fix this issue.

rootVIII commented 4 years ago

Oh glad to hear! Thanks again for the media icons as well

andydotxyz commented 4 years ago

Great, can you test develop branch please? The updated render and window init is landed which may have fixed this issue.

rootVIII commented 4 years ago

oh darn... I only have Kubuntu now and there seems to be no issues for Plasma. I have Virtualbox though. I could put an Ubuntu VM in there unless you have already tried in a VM?

andydotxyz commented 4 years ago

Sorry I’ve not been able to replicate so it’s down to you or @a2800276 to let me know if develop fixes it

a2800276 commented 4 years ago

Sorry about the delay. I couldn't find the minimal example which triggered this, but both the Desktop as well as the "Hello World" example seem to work fine in regard to the window being minimized on starting the application (Ubuntu 19 and 20). Trying to recreate the issue, I see similar behavior (minimal example attached) :

Upon starting the application, the jpeg within the icon is displayed with square proportions i.e. width == height. Both size and proportion don't correspond to the proportion or size of the underlying image. At least in the case of size, I assume this is intentional. Moving the mouse over the image and exiting towards the button re-renders the image icon to the proportions of the underlying image resource. If I pass the mouse over the image left-to-right or move the mouse out of the application window, nothing happens.

Code:

package main

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

func main() {
        a := app.New()
        r, _ := fyne.LoadResourceFromPath("./bla.jpg")
        w := a.NewWindow("Hello")
        w.SetContent(widget.NewVBox(
                widget.NewLabel("Hello Fyne!"),
                widget.NewButton("Quit", func() {
                        a.Quit()
                }),
                widget.NewIcon(r),
        ))

        w.ShowAndRun()
}

bla.jpg:

bla

a2800276 commented 4 years ago

Arg, just noticed that hovering over the 'quit' button triggers the rerender, the mouse doesn't need to touch the image icon at all.

andydotxyz commented 4 years ago

This seems like a different issue - but I cannot replicate it on develop - are you up to date with our current code?

a2800276 commented 4 years ago

I did the go get -u fyne.io/fyne/cmd/fyne_demo command to update, but I assume that's not develop. Could you tell me how to update to the develop branch? I'll try it out.

andydotxyz commented 4 years ago

Put @develop on the end - you’ll know if it worked as the tabs have changed on the latest version of the demo app.

a2800276 commented 4 years ago

Yepp, the proportions are now correct from the get-go and nothing changes when mousing over the button. Thanks for talking me through this!

roffe commented 1 year ago

I got the same issue on Windows 11. Sometimes windows are just a big white box until i resize them, then all the contents show

andydotxyz commented 1 year ago

This issue was resolved 2 years ago and refers to a different operating system. If you want to report your problem please open a new issue, that way we will get all the information we need to proceed with a new bug fix.