wails: Cannot set size of window on Ubuntu 22.04 (heigh and width is 0)
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 call runtime.WindowFullscreen(ctx) from go, you still start off with 0 widht and 0 height, but it becomes resizable via the GUI.
OS Version:
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
To Reproduce
Initialize project: wails init -n wails_issue_repro -t react-ts
Run wails dev or run wails build and execute build executable
Expected 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
~/tmp/wails-issue-repro/wails_issue_repro$ wails doctor
Wails CLI v2.0.0-beta.38
Scanning system - Please wait (this may take a long time)...Done.
System
------
OS: Ubuntu
Version: 22.04
ID: ubuntu
Go Version: go1.18.1
Platform: linux
Architecture: amd64
Wails
------
Version: v2.0.0-beta.38
Package Manager: apt
Dependency Package Name Status Version
---------- ------------ ------ -------
*docker docker.io Installed 20.10.17
gcc build-essential Installed 11.2.0
libgtk-3 libgtk-3-dev Installed 3.24.33-1ubuntu2
libwebkit libwebkit2gtk-4.0-dev Installed 2.36.3-0ubuntu0.22.04.1
npm npm Installed 8.5.1~ds-1
*nsis nsis Installed v3.08-2
pkg-config pkg-config Installed 0.29.2
* - Optional Dependency
Diagnosis
---------
Your system is ready for Wails development!
If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 42 (39 by maintainers)
I’m on vacation without internet. Will look at this next week!
@leaanthony
Thanks everyone for the amazing testing and feedback! This is now merged 🙏
Thank you. It works now.
This method solved my problem,But I think it’s a scaling issue ubuntu:setting->screen display->scale:100%
Works on a fresh installation of Ubuntu 22.04. This is likely an issue when upgrading from 21.10 to 22.04.
Thanks so much for taking the time to look at this @ianmjones ❤️ 👍 🚀
I never checked the value of
XDG_SESSION_TYPE. Maybe it’s wonky? I’ll check it out when I’m on my personal computer next.