Skip to content

Commit

Permalink
Use Gio.Application.run_async()
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Sep 24, 2023
1 parent fc8f1b8 commit 210aaef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Read books in style.

### Run Time Dependencies

- `gjs` (>= 1.72)
- `gjs` (>= 1.76)
- `gtk4` (>= 4.12)
- `libadwaita` (>= 1.4; `gir1.2-adw-1` in Debian-based distros)
- `webkitgtk-6.0` (`webkitgtk6.0` in Fedora; `gir1.2-webkit-6.0` in Debian-based distros)
Expand Down
13 changes: 2 additions & 11 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,5 @@ else {
}
pkg.useResource = MESON

// run application
// see https://gitlab.gnome.org/GNOME/gjs/-/issues/468
const { mainloop } = imports
import(pkg.moduleuri('app.js'))
.then(({ Application }) => setTimeout(() => {
mainloop.quit()
exit(new Application().run([programInvocationName, ...programArgs]))
}))
.catch(e => console.error(e))

mainloop.run()
const { Application } = await import(pkg.moduleuri('app.js'))
exit(await new Application().runAsync([programInvocationName, ...programArgs]))

0 comments on commit 210aaef

Please sign in to comment.