Merge pull request #154 from Robinhuett/window_ignore_self

fix(window): Ignore waybar
This commit is contained in:
Alex 2019-01-27 02:09:44 +01:00 committed by GitHub
commit 6f2d784d4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

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