From d05b8398fa98b988af7e5fcad80a7aedc6112bf1 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 15 Apr 2019 11:42:16 +0200 Subject: [PATCH] fix: prefer to hold running even when no window is open --- include/client.hpp | 2 +- src/client.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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);