Skip to content

Commit

Permalink
fix: prefer to hold running even when no window is open
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed Apr 15, 2019
1 parent ecc5f48 commit d05b839
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Client {
Client(int argc, char *argv[]);
int main(int argc, char *argv[]);

Gtk::Main gtk_main;
Glib::RefPtr<Gtk::Application> gtk_app;
std::string css_file;
std::string config_file;
Glib::RefPtr<Gdk::Display> gdk_display;
Expand Down
5 changes: 3 additions & 2 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <iostream>

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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d05b839

Please sign in to comment.