Skip to content

Commit

Permalink
Merge pull request #1026 from euclio/idle-inhibit-fix
Browse files Browse the repository at this point in the history
disable Idle Inhibitor module if unsupported
  • Loading branch information
Alexays authored Feb 10, 2021
2 parents c5f875d + 95a6689 commit 36da811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/idle_inhibitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar&
bar_(bar),
idle_inhibitor_(nullptr),
pid_(-1) {
if (waybar::Client::inst()->idle_inhibit_manager == nullptr) {
throw std::runtime_error("idle-inhibit not available");
}

event_box_.add_events(Gdk::BUTTON_PRESS_MASK);
event_box_.signal_button_press_event().connect(
sigc::mem_fun(*this, &IdleInhibitor::handleToggle));
Expand Down

0 comments on commit 36da811

Please sign in to comment.