Before the module would just try to evenly distribute desktops
(workspaces) among the viewports.
But since `_NET_DESKTOP_VIEWPORT` actually maps desktops to viewports,
we can use that information to assign workspaces to the right viewport.
Fixes#1849Fixes#1764
Before it would only reload if the size changed and even that was
reliable since the method relied on the order of the monitor list.
Now if the monitor list differs in any way (pos, dimension, primary,
output, name) a reload is issued
Because of how monitors are removed inside the loop and depending on the
monitor order a cloned monitor may be assigned a width of 0 but is never
actually removed resulting in polybar saying the bar is out of bounds
Fixes#1794
Premature optimization that tried to cache monitors but the cache did
not take into account the parameter values.
The call `get_monitors(..., ..., false, true);` would get all connected
and unconncected monitors a subsequent call
`get_monitors(..., ..., true, false);` would get back the same list of
monitors even though it requested only connected monitors.
Additionally `get_monitors` is never called periodically so the
optimization really didn't help much.
This adds `monitor-exact = true` in the bar section
This also properly does best-match instead of first-match if multiple
matches exists. For example if there are two monitors HDMI2 and HDMI-2
and we try to match HDMI-2 with monitor-exact = false, until now HDMI2
would be matched. Now exact matches are always preferred.
Fixes#1532