Since idle_inhibitor's have a surface, we should have one for each inhibitor module. Therefore, the status is stored on the Client, and all modules create or destroy their inhibitors depending on Client's idle_inhibitor_status. Also, when modules are destroyed they remove themselves from Client's idle_inhibitor_modules.

This commit is contained in:
Jordan Leppert
2020-11-01 13:33:28 +00:00
parent aa4fc3dd29
commit 4889e655eb
3 changed files with 33 additions and 22 deletions

View File

@ -12,12 +12,12 @@ class IdleInhibitor : public ALabel {
IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
~IdleInhibitor();
auto update() -> void;
struct zwp_idle_inhibitor_v1* idle_inhibitor_ = nullptr;
private:
bool handleToggle(GdkEventButton* const& e);
const Bar& bar_;
std::string status_;
int pid_;
};