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

App.Simple: Close App window before exiting #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rvl
Copy link

@rvl rvl commented Sep 17, 2024

Gtk doesn't destroy its windows when gtk_main_exit() is called. It relies on the X server to DestroyAll resources when the app's connection to the X server is closed.

This can result in zombie windows for programs which don't immediately exit after the Gtk main loop finishes.

We solve it by explicitly destroying the window widget in response to the Exit transition.

Also, for gtk_widget_destroy() to have any effect, the Gtk main loop needs to be still running. Thankfully, the run function provided by GI.Gtk.Declarative.App.Simple will ensure that is the case.

Resolves #105

Gtk doesn't destroy its windows when `gtk_main_exit()` is called. It
relies on the X server to DestroyAll resources when the app's
connection to the X server is closed.

This can result in zombie windows for programs which don't immediately
exit after the Gtk main loop finishes.

We solve it by explicitly destroying the window widget in response to
the `Exit` transition.

Also, for gtk_widget_destroy() to have any effect, the Gtk main loop
needs to be still running. Thankfully, the `run` function provided by
`GI.Gtk.Declarative.App.Simple` will ensure that is the case.

Resolves owickstrom#105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window is not destroyed when event loop stops, only when program exits
1 participant