diff --git a/include/client.hpp b/include/client.hpp index eb1ef2b4..5f0e9e59 100644 --- a/include/client.hpp +++ b/include/client.hpp @@ -15,7 +15,7 @@ class Client { Client(int argc, char *argv[]); int main(int argc, char *argv[]); - Gtk::Main gtk_main; + Glib::RefPtr gtk_app; std::string css_file; std::string config_file; Glib::RefPtr gdk_display; diff --git a/src/client.cpp b/src/client.cpp index 6d2d273b..d05e2564 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -3,7 +3,7 @@ #include waybar::Client::Client(int argc, char* argv[]) - : gtk_main(argc, argv), + : gtk_app(Gtk::Application::create(argc, argv, "fr.arouillard.waybar")), gdk_display(Gdk::Display::get_default()) { if (!gdk_display) { @@ -140,7 +140,8 @@ int waybar::Client::main(int argc, char* argv[]) } setupConfigs(config, style); bindInterfaces(); - gtk_main.run(); + gtk_app->hold(); + gtk_app->run(); bars.clear(); zxdg_output_manager_v1_destroy(xdg_output_manager); zwlr_layer_shell_v1_destroy(layer_shell);