Open dogamak opened 7 years ago
I haven't looked into xcb that much yet, I'd assume I would have to use xcb_randr_get_crtc_info
to get the info about the single output? Or is there a different way to do this?
That would seem to be the right way to do it, the ruxt-xcb
crate seems to have bindings for randr under xcb::randr
. While we are at it, we should probably add support for Xinerama too.
Xinerama seems to be the old version of RandR. I am not entirely sure if that is required or if randr can do everything.
XRandR can do pretty much everything Xinerama can do, so supporting it would be purely for compatibility. Now that I look it up, XRandR seems to be built into Xorg since 2007, so I doubt supporting Xinerama is really a necessity.
I've send a PR https://github.com/dogamak/xcbars/pull/19 that should make fixing this pretty simple. I can look into it tomorrow when I have the time.
So after #19 fixed the issues I've talked about in #17 it seems like this could be fine? Or is there still more things you want to change for multihead support? @dogamak
Should be just a matter of modifying
calculate_geometry
insrc/bar_builder.rs
to take multiple displays into account and giving the user control over which monitor to display the bar on.Display name could be specified in
Geometry::Relative
. If you useGeometry::Absolute
, you can just do the math.In future we could probably run multiple bars on the same process, but that isn't really something to worry about yet.