dogamak / xcbars

Bar library created with rust and xcb.
Apache License 2.0
1 stars 1 forks source link

Multihead support #18

Open dogamak opened 7 years ago

dogamak commented 7 years ago

Should be just a matter of modifying calculate_geometry in src/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 use Geometry::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.

chrisduerr commented 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?

dogamak commented 7 years ago

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.

chrisduerr commented 7 years ago

Xinerama seems to be the old version of RandR. I am not entirely sure if that is required or if randr can do everything.

dogamak commented 7 years ago

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.

chrisduerr commented 7 years ago

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.

chrisduerr commented 7 years ago

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