diff --git a/internal/messages/composer/input_good_os.go b/internal/messages/composer/input_good_os.go index 247a8b6..8204eda 100644 --- a/internal/messages/composer/input_good_os.go +++ b/internal/messages/composer/input_good_os.go @@ -6,6 +6,7 @@ import ( "log/slog" "github.com/diamondburned/gotk4/pkg/gtk/v4" + "github.com/diamondburned/gotkit/app" "github.com/diamondburned/gotkit/app/prefs" "libdb.so/gotk4-sourceview/pkg/gtksource/v5" "libdb.so/gotk4-spelling/pkg/spelling" @@ -17,6 +18,13 @@ var spellCheck = prefs.NewBool(true, prefs.PropMeta{ Description: "Enable spell checking in the composer.", }) +func init() { + app.Hook(func(*app.Application) { + gtksource.Init() + spelling.Init() + }) +} + func initializeInput() initializedInput { languageManager := gtksource.LanguageManagerGetDefault() spellChecker := spelling.CheckerGetDefault() diff --git a/main.go b/main.go index 0641860..57a55fd 100644 --- a/main.go +++ b/main.go @@ -18,8 +18,6 @@ import ( "libdb.so/dissent/internal/gtkcord" "libdb.so/dissent/internal/window" "libdb.so/dissent/internal/window/about" - "libdb.so/gotk4-sourceview/pkg/gtksource/v5" - "libdb.so/gotk4-spelling/pkg/spelling" _ "github.com/diamondburned/gotkit/gtkutil/aggressivegc" _ "libdb.so/dissent/internal/icons" @@ -60,8 +58,6 @@ func init() { app.Hook(func(*app.Application) { adw.Init() adaptive.Init() - spelling.Init() - gtksource.Init() }) }