mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
fix(bspwm): Focus monitor before sending scroll cmd #503
This commit is contained in:
parent
02833b7871
commit
d6b0c5f003
1 changed files with 15 additions and 9 deletions
|
@ -473,25 +473,31 @@ namespace modules {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
string modifier;
|
|
||||||
string scrolldir;
|
string scrolldir;
|
||||||
|
|
||||||
if (m_pinworkspaces) {
|
|
||||||
modifier = ".local";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd.compare(0, strlen(EVENT_SCROLL_UP), EVENT_SCROLL_UP) == 0) {
|
if (cmd.compare(0, strlen(EVENT_SCROLL_UP), EVENT_SCROLL_UP) == 0) {
|
||||||
scrolldir = m_revscroll ? "prev" : "next";
|
scrolldir = m_revscroll ? "prev" : "next";
|
||||||
} else if (cmd.compare(0, strlen(EVENT_SCROLL_DOWN), EVENT_SCROLL_DOWN) == 0) {
|
} else if (cmd.compare(0, strlen(EVENT_SCROLL_DOWN), EVENT_SCROLL_DOWN) == 0) {
|
||||||
scrolldir = m_revscroll ? "next" : "prev";
|
scrolldir = m_revscroll ? "next" : "prev";
|
||||||
}
|
|
||||||
|
|
||||||
if (!scrolldir.empty()) {
|
|
||||||
send_command("desktop -f " + scrolldir + modifier, "Sending desktop " + scrolldir + " command to ipc handler");
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string modifier;
|
||||||
|
|
||||||
|
if (m_pinworkspaces) {
|
||||||
|
modifier = ".local";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& mon : m_monitors) {
|
||||||
|
if (m_bar.monitor->match(mon->name, false) && !mon->focused) {
|
||||||
|
send_command("monitor -f " + mon->name, "Sending monitor focus command to ipc handler");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
send_command("desktop -f " + scrolldir + modifier, "Sending desktop " + scrolldir + " command to ipc handler");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue