-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot set size of window on Ubuntu 22.04 (heigh and width is 0) #1517
Comments
After posting this I saw maintainers asking whether issues occur when using the vanilla template. I tried again with the vanilla template and I'm still seeing the same issue. |
I added a printf to see if maybe the window sizes were getting borked, but it seems okay printf:
output in terminal:
Another thing. When setting the GTK_DEBUG environment with the following value I see the When setting the GTK_DEBUG environment with the following value I see this output in the terminal (trimmed for brevity)
|
Thanks for the quick response @leaanthony , the fix mentioned in your comment here #1420 (comment) did not work for me (as per the commentor's follow up, I ensured the the environment variabl wasn't set in any other way as well). However, I did find a different workaround in the meantime. If you call Strangely, if you set up your App with large
|
Thanks for testing again. Perhaps this is a genuine resizing bug (it sounds like it). I'll install 22.04 in a VM and try. Do you run it in a VM? I'm wondering if that'll affect whether Wayland runs or not. |
No, I'm not running in a VM. It's running on real hardware. |
Right, that might affect my testing but we'll see 👍 |
I never checked the value of |
My |
I just created a clean Svelte template app with Wails v2.0.0-beta.38, and then added some functions to test using both the JS and Go versions of If you download this test app to test it yourself, please ensure you This app worked fine on NixOS with i3-wm under X11 (my main machine). I then used an Ubuntu 22.04 QEMU VM to test the same app under both X11 and Wayland. I found that it crashed due to a bug (#1443) that has already been fixed (#1464). So I checked out I then used In the following (silent) screen capture you can see me testing the binary on X11, logging out, switching to a Wayland session, and then testing again: wails-test-with-wayland-and-x11.mp4Maybe this app would be a good start for exploring where the problem is on your system @skamensky, and @acheong08 you may also find it useful for testing your issue (#1471). If the app does not work for you after setting up against If the app does work for you after setting up against |
Thanks so much for taking the time to look at this @ianmjones ❤️ 👍 🚀 |
I have built the app on both Ubuntu 20.04 (Server) and 22.04 (Desktop). Attempting to run either of the executable results in height and width of 0 on Ubuntu 22.04. The issue is thus most likely with possible changes I have made to my computer rather than the project itself. Will test on a fresh installation when possible. |
This seems to be a genuine workaround. It works properly when MaxHeight and MaxWidth are set |
This really does sound like a calculation error but nobody can reproduce 😳 Any chance you could add a bunch of printfs to the code around these calculations and determine what is causing this? Would be great to find an edge case to fix. |
Works on a fresh installation of Ubuntu 22.04. This is likely an issue when upgrading from 21.10 to 22.04. |
This method solved my problem,,But I think it's a scaling issue |
Oooh, that's an interesting angle. Are you saying that when the screen scale (DPI related?) is not 100%, this bug happens? |
That might be the issue, seems like scaling is only done in the Fullscreen code path but not when setting min/max. According to the code. |
@alekodad @acheong08 @skamensky - Please try the linked PR. I've added scaling code when setting min/max height and am hoping this is enough. We potentially also need to consider scale when using |
Branch does not fix issue. The fact that the max width and height calculates to zero probably means multiplying the scale won't work. x*0 = 0
This does indeed work. Can confirm it as a scaling issue. |
@leaanthony , your new code was giving me compilations errors on ubuntu. I created a PR for the changes that enabled me to compile with no errors or warnings In any case, this did not fix the issue. The workaround with the new code still works, however. |
Bah, I didn't have time to test just pushed it out. I'll do some proper debugging on this over the weekend. |
Ok, update: It looks like it's some weird GTK bug when the scale is not 100%. You can see it working kinda fine if you do: |
Issue unresolved
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Did you use |
Hey @leaanthony , the changes in 764dadc are a partial fix for this! In app attributes:
Debug output: (startup line is from the
This is what it looks like when I set the app attribute |
I did |
Yeah, nice testing! I know we aren't dealing with scaling at all. The fix is just to get the window displayed. Thanks for looking at the different scenarios. Let's see if we can nail this 👍 |
Go projects need to update go.mod if you want to use non-module code: https://wails.io/docs/guides/bleeding-edge |
Thank you. It works now. |
@skamensky - App attribute fullscreen works for me. What's interesting is that there are different sizes for MAX in the console... |
I tested this PR and now it opens in 200% scale without setting MaxHeight and MaxWidth |
@skamensky any updates? |
@leaanthony will look at this today. I'll try and play around with my scaling settings to see if there's some machine specific configuration that's changing things around. Also will explore the discrepancy we saw with MAX. |
The wails/v2/pkg/options/default.go Lines 9 to 15 in 449d345
Also, I've tracked down the issue with fullscreen. There seems to be some conflation between the With the current code from 449d345 Setting
However, if we make this change Then setting
Where is wails/v2/pkg/options/options.go Line 75 in 449d345
|
Oh good catch. Fullscreen is deprecated. I need to sort that out 👍 |
Thanks everyone for the amazing testing and feedback! This is now merged 🙏 |
@skamensky would it be possible for you to try this PR and ensuring min/max size work as expected for your scaled environment? 🙏 #1656 |
I'm on vacation without internet. Will look at this next week! |
Description
When running wails, both in dev and build mode on Ubuntu, the height and width are zero. I ran the same exact code on MacOS and it works.
It's stuck at (seemingly) 0 width and 0 height. If you pass it the
Fullscreen
argument in app initialization, or callruntime.WindowFullscreen(ctx)
from go, you still start off with 0 widht and 0 height, but it becomes resizable via the GUI.OS Version:
To Reproduce
Initialize project:
wails init -n wails_issue_repro -t react-ts
Run
wails dev
or runwails build
and execute build executableExpected behaviour
Window respects size of initial app config and is programatically resizable.
Screenshots
Attempted Fixes
Search through github and did not find any fixes or same issues
System Details
Additional context
No response
The text was updated successfully, but these errors were encountered: