-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Init GTK in NewFrontend
, not init
#2841
Conversation
So apps that have a headless / non-gui mode will be able to run, since they needn't call `NewFrontend` (which is called by `CreateApp`). Previously, `init` would call `C.gtk_init` regardless of whether CreateApp was called. Also change to call `C.gtk_init_check` with a panic, instead of `C.gtk_init`, since `gtk_init` just exits the process if it fails, without a sensible error message. Fixes wailsapp#2628.
Could the |
I expect so, but I don't understand how that would affect things. How would it work better? It seems unrelated to the bugfix... |
I'm sorry the prg_name would be working better if it's set before gtk_init. It's not related to the bug at all. Just thought if the gtk_init is moved we could move set_prgname to a better place in one PR. That's all. Edit. I'll make another PR for it when it's merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙏
Any idea when this may get released in a release? |
Looking to do a release end of the week. Thanks for your patience. In the meantime you can always use the master branch so there shouldn't be any reason for you to be blocked. That'd also mean you can test to see if everything works as expected. |
Absolutely - I'm planning on testing it tomorrow 👍 Just wanted to know how long to expect to run off master ;) :) thanks! |
Description
So that apps that have a headless / non-gui mode will be able to run, since they needn't call
NewFrontend
(which is called byCreateApp
). Previously,init()
would callC.gtk_init
regardless of whether CreateApp was called.Also, we call
C.gtk_init_check
and check the return value (and panic on failure), instead ofC.gtk_init
, sincegtk_init
just exits the process if it fails, without a sensible error message.Fixes #2628.
Inspired by #2629, but slightly cleaner imho.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Unset
DISPLAY
env varRun our app (which has a
--headless
flag) in headless mode, and it runs ok. Before the change, it would exit.Run the app without the
--headless
flag, and see a stacktrace:After setting the
DISPLAY
env var, the app works as normal.Test Configuration
output from
wails doctor
:Checklist:
website/src/pages/changelog.mdx
with details of this PR