151a263654
* fix(monitor): do not include outputs when monitors are supported Previously, when splitting an output into two monitors, `polybar -m` would report both the splitted monitors and the output. This was not caught by the the clone detection as the detection works by removing monitors contained into another monitors (and monitors were excluded from that logic) and we want the other way around: outputs covered by monitors should be ignored. Instead of trying to detect covered outputs, the solution is quite simple: when monitors are supported, do not consider outputs, unless we request all outputs. A monitor can be set primary (and RandR reports primary outputs as primary monitors). The only information we would miss from monitors are things like refresh rate and EDID. We don't need that, so we are fine. As monitors are only created for connected output (and they are in this case "active") or disconnected output if they are mapped (and they are in this case "inactive"), I am a bit unsure if we have exactly the same behaviour as previously when `connected_only` is set to `false`. As some modules require an output, we keep the output in the `monitor_t` structure and we ensure it is correctly set when using monitors. A monitor can have 0 or several outputs. We only handle the 0 and 1 cases. When a monitor has more outputs, only the first one is used. AFAIK, only the xbacklight module needs that and I think we are fine waiting for a user needing this module and merging monitors. The C++ binding fail to expose the `outputs()` method to iterate over the outputs of a monitor. This seems to be a bug in XPP. The field is correctly defined in the RandR XML file and it works with the Python binding. ```xml <struct name="MonitorInfo"> <field type="ATOM" name="name" /> <field type="BOOL" name="primary" /> <field type="BOOL" name="automatic" /> <field type="CARD16" name="nOutput" /> <field type="INT16" name="x" /> <field type="INT16" name="y" /> <field type="CARD16" name="width" /> <!-- pixels --> <field type="CARD16" name="height" /> <!-- pixels --> <field type="CARD32" name="width_in_millimeters" /> <field type="CARD32" name="height_in_millimeters" /> <list type="OUTPUT" name="outputs"> <fieldref>nOutput</fieldref> </list> </struct> ``` Falling back to C only to access the list of outputs is not enough because the list is appended to the structure and not visible through the public API. When copied, the structure loses the list of monitors. Also, change the mention "XRandR monitor" to "no output" when there is no output attached. People using monitors know what it means and it is useful to catch a future regression where we don't have an output at all (which would break the brightness plugin). Fix #2481 * Update CHANGELOG.md Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com> |
||
---|---|---|
.. | ||
adapters | ||
cairo | ||
components | ||
drawtypes | ||
events | ||
modules | ||
tags | ||
utils | ||
x11 | ||
CMakeLists.txt | ||
ipc.cpp | ||
main.cpp | ||
settings.cpp.cmake |