Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.Resize() does not work if SetFixedSize(true) is set after #2819

Closed
FredPont opened this issue Mar 4, 2022 · 12 comments
Closed

window.Resize() does not work if SetFixedSize(true) is set after #2819

FredPont opened this issue Mar 4, 2022 · 12 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working OS:Linux Tickets affecting only Linux

Comments

@FredPont
Copy link

FredPont commented Mar 4, 2022

Describe the bug:

In Fyne 2.1.3 the order of window.Resize() and SetFixedSize(true) matters. This is not the case in Fyne 2.1.2

To Reproduce:

This code only works on Fyne 2.1.2. On Fyne 2.1.3, it does not resize the window w which appears minimized :

w.Resize(fyne.NewSize(finalWidth, finalHeight)) 
w.SetFixedSize(true)

Whereas this code works perfectly

w.SetFixedSize(true)
w.Resize(fyne.NewSize(finalWidth, finalHeight)) 

Device :

  • OS: Linux Manjaro
  • Version: up do date 2022-03-04
  • Go version: go1.17.6 linux/amd64
  • Fyne version: 2.1.3
@FredPont FredPont added the unverified A bug that has been reported but not verified label Mar 4, 2022
@kheyse-oqton
Copy link

kheyse-oqton commented Mar 7, 2022

May or may not be related to #2800, another window resize/fixedsize related regression

@andydotxyz
Copy link
Member

Thanks for connecting the two, but #2800 isn't a regression as far as I know, the initial size of an image using FillOriginal has always been off, it corrects on the second draw. Normal windows then adjust accordingly but FixedSize windows don't. It too needs fixed, but this regression is much higher priority.

@kheyse-oqton
Copy link

it is a regression because in 2.0 the same code works without problem.
but we should probably discuss that on that issue.

@andydotxyz
Copy link
Member

  • OS: Linux Manjaro

I cannot replicate on macOS, this may be Linux specific which could explain why it was missed I guess.
Window sizing is one of the most complex code paths :(.

@andydotxyz andydotxyz added the OS:Linux Tickets affecting only Linux label Mar 7, 2022
@andydotxyz
Copy link
Member

I cannot replicate on Debian/FyneDesk either. Can you please provide more info about the failing WM and desktop setup @FredPont ?

@andydotxyz
Copy link
Member

This may also depend on the content of the window I guess - the excerpt provided may not be enough to replicate.

@FredPont
Copy link
Author

FredPont commented Mar 7, 2022

I cannot replicate on Debian/FyneDesk either. Can you please provide more info about the failing WM and desktop setup @FredPont ?

@andydotxyz

I did the test on 3 computers with XFE 4.16.
computer 1 & 2 Linux manjaro
computer 3 : Xubuntu 21.10

I reproduce the issue on the 3 computers with my software based on Fyne. In this software, the window content is a multilayer scroll image with a PNG picture, an interactive raster, and containers for drawing. It is thus difficult to build a toy program with this structure (maybe it could be reproduced with pixel editor).

type Editor struct {
	drawSurface                     *interactiveRaster
	microscop                       *canvas.Image
	min                             fyne.Size 
	layer                           *fyne.Container 
	win                             fyne.Window
	gateContainer                   *fyne.Container
	gateNumberContainer             *fyne.Container
	gateDotsContainer               *fyne.Container
	clusterContainer                *fyne.Container

}

the final window content is :

e.layer = container.NewMax(e.drawSurface, e.microscop, e.clusterContainer, e.gateContainer, e.gateDotsContainer, e.gateNumberContainer)

w.SetContent(container.NewScroll(e.layer))

Please note that the 3 computers use a Nvidia card.

Here are more informations about one of my manjaro computer :

cat /etc/lsb-release
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=21.2.4
DISTRIB_CODENAME=Qonos
DISTRIB_DESCRIPTION="Manjaro Linux"
lspci -v
VGA compatible controller: NVIDIA Corporation GF119 [NVS 310] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: NVIDIA Corporation Device 094e
        Physical Slot: 2
        Flags: bus master, fast devsel, latency 0, IRQ 92, NUMA node 0
        Memory at f2000000 (32-bit, non-prefetchable) [size=16M]
        Memory at e8000000 (64-bit, prefetchable) [size=128M]
        Memory at f0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 7000 [size=128]
        Expansion ROM at f3000000 [virtual] [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia
systemctl status display-manager
● lightdm.service - Light Display Manager
     Loaded: loaded (/usr/lib/systemd/system/lightdm.service; enabled; vendor preset: disabled)
     Active: active (running) since Fri 2022-03-04 16:03:29 CET; 2 days ago
       Docs: man:lightdm(1)
   Main PID: 1164 (lightdm)
      Tasks: 6 (limit: 77166)
     Memory: 51.2M
        CPU: 2.218s
     CGroup: /system.slice/lightdm.service
             ├─1164 /usr/bin/lightdm
             ├─1177 /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
             └─1362 lightdm --session-child 12 19

@andydotxyz
Copy link
Member

I did the test on 3 computers with XFE 4.16.

Maybe it is specific to that WM?

Is it possible to replicate the problem with a minimal example, that will be very helpful.
For example a small modification to the hello world example?

@andydotxyz andydotxyz added this to the Fixes (v2.1.x) milestone Mar 7, 2022
@andydotxyz andydotxyz added the blocker Items that would block a forthcoming release label Mar 7, 2022
@FredPont
Copy link
Author

FredPont commented Mar 8, 2022

@andydotxyz ,

I send you a zip file with a minimal example to reproduce the issue and a video showing that, depending on the position of w.SetFixedSize(true), the fyne window is minimized or not.

debug.mp4

debug.zip

@andydotxyz
Copy link
Member

Thanks, verified with this code - it seems that some content triggers it and others don't

@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Mar 8, 2022
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Mar 8, 2022
@andydotxyz
Copy link
Member

andydotxyz commented Mar 8, 2022

If you get a chance please test #2829 - I think it resolves this issue

@andydotxyz
Copy link
Member

Fixed in v2.1.4 under vote now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working OS:Linux Tickets affecting only Linux
Projects
None yet
Development

No branches or pull requests

3 participants