fix(window): Ignore waybar

With this, the window title waybar will be ignored so it wont flicker as decribed in #148
This commit is contained in:
Robinhuett 2019-01-26 19:02:11 +01:00
parent a0fd99b112
commit ce6816737c
1 changed files with 3 additions and 1 deletions

View File

@ -23,9 +23,11 @@ void waybar::modules::sway::Window::worker()
try {
auto res = ipc_.handleEvent();
auto parsed = parser_.parse(res.payload);
// Check for waybar prevents flicker when hovering window module
if ((parsed["change"] == "focus" || parsed["change"] == "title")
&& parsed["container"]["focused"].asBool()) {
window_ = Glib::Markup::escape_text(parsed["container"]["name"].asString());
window_ = Glib::Markup::escape_text(parsed["container"]["name"].asString()
&& parsed["container"]["name"].asString() != "waybar");
windowId_ = parsed["container"]["id"].asInt();
dp.emit();
} else if ((parsed["change"] == "close"